Javascript file upload

October 26, 2005

Is it possible to do a file upload with javascript? Short answer: no. Is it possible to trap file upload events with javascript? the short answer is again no. But there is always a way.

Fortunately in software it's very dangerous to say something is impossible. (People told us Rad SFTP is impossible to build but we built it anyway).

We have just added a new feature to Rad Upload, That makes it very easy to recieve javascript notifications when an upload is completed. In fact it's ridiculously easy. All you need to do is uncomment a single line in the configuration file. Then once the file transfer is completed the applet will call a javascript function named uploadCompleted(). The response returned by the server is passed through as a parameter.

In addition to the callback, Rad Upload exposes two methods that can be invoked by javascripts. These can be used to determine if the last upload was successfull, failed or was cancelled. Another method allows you to retrieve the last response returned by the server.

Now to get back to the original question. Is it possible to do a javascript upload? One solution is to call a method in Rad Upload from your javascript and ask the applet to start uploading. However the method to start the upload has been intentionally kept hidden. No prizes for guessing why.

Posted by raditha at October 26, 2005 9:01 PM
Your Ad Here

 

Jabber  |  Linux  |  mySQL  |  PHP  |  Java  |  Site Map  |  Wiki

Downloads  |  About  |  Links  |  Contact  |  Home

 

Copyright © Raditha Dissanayake 2003 - 2007

Terms of Use  |  Privacy

 

 

October 2005
Sun Mon Tue Wed Thu Fri Sat
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31