Question: Has anyone done this? If so, what tools/techniques/approaches did you use?

Is it possible to do with installing the SQL Business Studio Version of Visual Studio?

Thanks in advance!

Answer: 
Replace this:

```
// Create parameters
$params = new stdClass;
$params->AWSAccessKeyId = self::$__accessKey;
$params->key = $uriPrefix.'${filename}';

```

with this:

```
function rand_string( $length ) {
            $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";  

            $size = strlen( $chars );
            for( $i = 0; $i < $length; $i++ ) {
                $str .= $chars[ rand( 0, $size - 1 ) ];
            }

            return $str;
        }       

        // Create parameters
        $params = new stdClass;
        $params->AWSAccessKeyId = self::$__accessKey;
        $params->key = $uriPrefix.rand_string(5).'${filename}';

```
You can do your renaming at this point in your code:

```
move_uploaded_file($tmp, $filelocation);

```

The `$filelocation` can be changed to whatever you want and the uploaded file will be renamed to that path.

**Edit**: The `S3::getHttpUploadPostParams` method always uses the file name from the upload to create the S3 resource. To change that you have to copy the method but change this line:

```
$params->key = $uriPrefix.'${filename}';

```

The `'${filename}` must be changed to a path of your choosing.