Post form data before upload starts

Upload core product.
Post Reply
jmrico
Posts: 4
Joined: Thu Mar 25, 2010 2:10 am

Post form data before upload starts

Post by jmrico »

I swear did a thorough check through the documentation and this forum as well, so I'm sorry if this problem has already been posted elsewhere.
We a have our file upload webpage, where there is a form for the user to fill, and the jfileupload applet as well.

Here's the chain of events we need, please telll me if its possible:

1. User arrives, types in some nonsense in the form, select his files tu upload
2. User clicks "start"
3. At this time we need the form data posted to a database, BEFORE the upload starts
4. Upload finishes, then another post, page refresh or a complete redirect, makes no difference which.

We made several attempts with jfile and jbatchupload, but no avail, as I see there is no way
to fire up the upload process from JS (as in the user clicking the form submit, thus executing JS which would start the upload). And there is no way to send user-typed data to the server right before the upload starts.

Is there a way to implement this scenario?

Thanks,

Juan

User avatar
support
Posts: 1503
Joined: Sun Jan 27, 2008 6:19 pm

Re: Post form data before upload starts

Post by support »

Yes, you can install JSAPI add-on. Then you will get JavaScript callback before and after upload.
In the first call back you can send HTTP request to your server with XMLHTTPRequest.
See: http://www.jfileupload.com/products/tools/index.html

jmrico
Posts: 4
Joined: Thu Mar 25, 2010 2:10 am

Re: Post form data before upload starts

Post by jmrico »

Thanks for the reply. Sounds like that exactly what we need, we will look into it right away.

Post Reply