Customizing the Server-Side Upload Script

The server-side upload script does all the work on the back-end  when it comes to actually saving the uploaded files to the server.  Here is a bit of information that should help you get a handle on creating a custom server-side upload script in PHP that will accomplish what you need it to.

Passing Extra Data to the Server-Side Script

Extra data can be passed to the script as either a querystring attached to the uploader option, or via the formData option.  Depending on what you’ve set as the method option (‘post’ or ‘get’), you can retrieve the information sent in the formData option in the server-side script using the $_POST or $_GET array.

When initializing Uploadify:

In the server-side script:

This is useful if you want to do something like save the file under a different name.  If you want to pass information that is set on the page before the upload begins, it’s best to use the settings method in the onUploadStart event so the formData is set right before the file uploads.

Returning Data From the Server-Side Script

Anything that is echoed in the uploadify.php script is accessible via the onUploadSuccess event as the second argument (data).

Return the file name from the uploadify.php file: