Forums

[SOLVED] Preload Image - Upload

rmeijer 09 Apr, 2010
Hello,

I am trying to create a preloading-image while uploading a file after clicking submit.
But how and where can I include the preloader?
It only should pupup when the upload has been started... So after clicking submit...
Some files can be about 50MB, so it's important the uploader knows the file is uploading to the server.

[attachment=0]91.gif[/attachment]

Please your help.

Rog
GreyHead 09 Apr, 2010
Hi rjmeier,

I think that you need to be using a Flash uploader for that to work. Fredrik's been posting a bit about those.

Bob
nml375 09 Apr, 2010
Hi,
The most simple approach would be to add a submit/click event for the form/submit-button, and add an image element with the url to the image. The displayed image would not be linked to the actual form submission or file upload however, but would rather be considered a notification that the user has already pressed the submit button.

The more advanced approach would be a flash uploader, which actually allows your user to upload one or more files while filling out the rest of the form. Depending on the uploader you choose, you might also have the option of displaying a progress bar, and preventing form submission until all files are uploaded. I'm currently in the final stages of a similar project, and could probably provide better pointers once completed. One issue to be aware of however, is a security restraint introduced in FlashPlayer 10, which prevents external triggering of the upload routine (simply put, it breaks alot of different flash uploaders out there, including the one used by Joomla Media Manager).

/Fredrik
nml375 10 Apr, 2010
Hi Rog,
I had a look at an older version of FancyUpload some time ago, I don't quite remember why I opted not to use it. Currently, I'm using swfupload, which I found very flexible and fairly easy to use. It also has a feature to resize images prior uploading them, which is needed by a project I'm working on.

To get either to work with Joomla+ChronoForms, you'll need to add the current session cookie to the transaction, as Flash isn't smart enough to pick this up from the current browser. You'll also want to provide information as to which component and task Joomla should use for this request (you'll probably want ChronoForms "extra" task). If you intend to use JSON or Ajax objects as result-code, you'll also want to set the format to raw.

Next, you'll have to figure out how to "link" the uploaded file with the current form session. The session storage is usually a good place to start, though you'll have to remember to retrieve these again in the "on submit" code, as ChronoForms will be completely unaware of the uploads without your help.

/Fredrik
This topic is locked and no more replies can be posted.