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 if the method option is set to ‘get’, or via the headers if it’s set to ‘post’. This is all done with the help of 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 do so in the onUploadFile event so the data is set right before the file uploads.