Hello -
Wondering if there is a way to auto load a file and path into the flash vars as well as to do an auto start.
I am loading the the SWFUpload tool from an application that is selecting the file on the users computer already. I would like to feed it into SWFUpload as a parameter and auto start the upload when it pops up.
Is there a way to do this?
Many thanks!
March 30, 2009 - 12:45pm
You can't preselect a file. That breaks all the security models and Flash (nor the browser) will let you do it.
Auto starting an upload can be done by using the Queue plugin or by simply calling this.startUpload() from the fileDialogComplete event.
March 30, 2009 - 5:42pm
Is there a way to display, in the HTML, the filename that was just uploaded? Similar to the way you show the speed info in the speed example. "td id=filename" or something like that?
March 30, 2009 - 9:35pm
Use the uploadComplete event. It sends you a file object with the file name.
Then you can use some JavaScipt code to take the file name and display it on the page.
Something like this:
<span id="filename"></span>
function uploadCompleteHandler(file) {
document.getElementById("filename").innerHTML = file.name;
}