Multiple File Selection With Simultaneous Upload And Ajax
I looked at a few free upload script sets for this and YUI Uploader is the
one I like best so far.
Learn about the free YUI Uploader and other
interesting Yahoo Developer projects at
http://developer.yahoo.com/yui/examples/uploader/uploader-advanced-queue.html
One problem I have with things like this is that it seems that
frequently, how to use them is so obvious to the developers that they don't dumb
the instructions down enough for people like me. I am posting this little
article to assist others who might be as confused as I was before I got it
figured out.
Download the YUI zip file and follow the accompanying
instructions.
After you get it set up, you may wonder, "Yeah, but how do
I get it to actually upload a file?"
Here is an example PHP script
preconfigured to work with the YUI "uploader-advanced-queue-clean.html" page:
Copy to Notepad and save as "upload_simple.php". Use it for testing only,
because this example has no security coded into it.
On the YUI Uploader example html form, you need to remember
to change the link to the server side processing form to your own. Also,
the url of the server side script MUST be absolute, it will not work if it is
relative!
function
upload() {
if (fileList != null) {
uploader.setSimUploadLimit(parseInt(document.getElementById("simulUploads").value));
uploader.uploadAll("http://your_domain_dot_com/upload_simple.php",
"POST", null, "Filedata");
}
}
A server side upload script for Classic ASP is even more simple, assuming
Windows Server with the ASPupload component:
<%
'for testing only this example is NOT secure!
Set Upload =
Server.CreateObject("Persits.Upload")
Count =
Upload.Save("C:/path-to-your-upload-folder/images/")
%>
"RawPHP Menu" - Lil Peck
LilPeck@gmail.com
View other PHP scripts and Classic ASP scripts at
Classic ASP Reference.
My
favorite scripts directory is Codango.com.
©2016 Lil Peck