Uploadify using multiple files, one mvc controller call - uploadify

From all I have read in Stackoverflow and Google, it seems that once again I am forced to work around IE. Since it doesn't support multi, I am forced to use Uploadify or some other 3rd party pluggin. Thanks Microsoft..
I want to verify that there is no way to automatically batch multi-select files into one MVC controller call using Uploadify. I think there are ways whereby a user can add files, then press a button to upload the files, but is this it??? What pluggin will allow a user to select 4 files, close the file browse dialog, then automatically send all of the files in one http post?????
thanks

You can check the documentation of uploadify, it can select multiple files using multi option.
You can also upload after all the files are queued using auto:false option.
Here is what you can upload after queuing

Related

Best practice for multiple (single) file uploads in JSF 2.2

Our JSF 2.2 web application may have the situation, that users have to fill in a formular where they have to upload multiple files.
Example
First Name: [ John ]
Last Name: [ Doe ]
Photo: [ choose File ] (no file chosen)
Passport: [ choose File ] (no file chosen)
I know that there is multiple upload forms like Primefaces but this doesn't fit to my requirement, since I want to know which file is either the photo or passport, and I need to validate the input, because the files are mandatory.
Option 1: Multiple single file uploads
The first option would be like in the example above. Just use multiple single <h:inputFile> tags.
Pros:
users select files when they are asked for
users know this kind of file uploads
Cons:
since there are more <h:inputFile> tags, every file upload will be processed during the form submit: so we might have to limit filesizes so that users won't run into problems
I did not try this: is it even possible to use multiple single file uploads in the same <h:form>?
Option 2: Upload in popup + callback
I have seen this sometimes and wondered why it was implemented that way. When you have to upload a file it opens a popup with a file upload. After the upload, the popup is closed and the form has selected the uploaded file.
Are there any hints/tutorials for this technique? Especially the between-window-communication is unclear for me.
Pros:
nearly the same as the standard way
Cons:
problems with popup-blockers
for this approach, fallback mechanics have to be implemented: what if the user cancels the form? when are uploaded files deleted, so that there are no garbage files?
Option 3: Upload in modal dialog + callback
To eliminate the popup blocker problem we could use a modal dialog for an upload. So we choose to upload a file, a new modal <p:dialog modal="true"/> opens and there inside the <h:inputFile> handles your upload.
I did try this and found out that AJAX uploads are not possible with <h:inputFile> or <p:inputFile mode="simple"> (can't find the source of BalusC's comment, but there is a similar one). My whole site got rerendered and my formular input was lost.
Pros:
nearly the same as the standard way
no problems with popup blockers
Cons:
even possible?
Option 4: "Upload Manager"
My last idea was to provide an upload manager. This is a view where users can see their uploaded files in a list/table and add files with a single <h:inputFile>, add descriptions, and so on. So the files are already in the system and get deleted after (say) 72 hours if they are not referenced.
Users then click on a link when they have to input a file, and choose the corresponding file from a list/table in a modal dialog. Therefore users have to upload their files first, before even filling a form, which is quite a pain, so it would be nice if they could also upload files in the modal dialog. (this would look like a view, where they have a single <h:inputFile> and a list of their already uploaded files). But there we have the same AJAX problem like in Option 3...
The only way I see to get around this, is to write something at the beginning of a form like:
For this form you need the following files in your upload manager:
- Photo
- Passport
Pros:
technically: good because it's always only one file in a submit (AJAX?)
no specific fallback mechanisms (except a 72hrs cronjob deleting unused files)
users can upload multiple files for the (say) next 20 forms - this is good in our web application
Cons:
users are not used to this technique
even possible?
Do you have any other ideas to handle with this situation? I can't be the only one with this.
Or are multiple file uploads like Primefaces good to configure for validations?
I hope you can help me out with this brainstorming

fineuploader - initial file list - edit file name functionality

When using the inital file list functionality to populate fineuploader with previously stored files, is it possible for the edit filename functionality to be used?
At the moment it seems that the edit elements are hidden in the template, although it would be relatively simply if this functionality were enabled to hook onto the rename trigger and save the updated filename via ajax (what i'm hoping to achieve).
So is there someway to enable the edit filename for the initial file list?
Your requirements are outside of the scope of a file upload library. If you want to allow your users to rename a file uploaded in a different session, you will need to provide for this in your custom web application. You can certainly modify the file list provided by Fine Uploader after it is rendered with the initial files.

How to receive a file after drag and drop

I'm trying to build a web application that allows users to drag and drop a file from their desktop (like justbeamit.com) to an "icon" that represents another user, and so that the different user could receive it on the other side. I see that this is possible using the dropzone.js feature, but I want to know is how it's possible to link this with the receiving function so that the other user could download it simply after receiving a notification. I know it sounds complicated, but wish you guys could do good on me by providing knowledge on how to link the drag and drop functionality with a function that allows the other user to receive and download the file. Thanks!
If you are using MVC framework you can get the file from controller as body.request.body.dataParts.get

Populate file list with previously uploaded files

Using the jQuery wrapped version of Fineuploader v3.3.
Is it possible to populate the file list with files already in the upload folder?
I think "_addToList(id, name)" should do the trick, but I can't get it to work. Any ideas?
Seems that they are currently working on this feature:
https://github.com/Widen/fine-uploader/issues/784
So, this will be available soon.
This is not a behavior that Fine Uploader currently supports. Fine Uploader only displays files that users have submitted to the uploader since the current uploader instance was created. It doesn't try to be an all-in-one web application. You could probably add your own item to the list/UI via javascript. That probably wouldn't be terribly difficult, but seems like an odd thing to do.
If you'd like to discuss your specific use case more, please open up a feature request in the Github issue tracker.
Generally, client side code cannot add stored or hard-coded path based file names for use in any type of POST or upload operation. Obviously this is a security measure, you can imagine if a malicious web page could add to a generic POST operation some type of baked in file name. So from what I understand, only the user can specify path based file names, via a file browser for the session that it is included in. This applies to HTML/JavaScript/jQuery but am unsure if Flash/Silverlight based solutions would also be limited. I think a Java based uploader would be free of this. But you are just moving closer and closer to installed software.

Valums file uploader: get full path to file in file system

I'm using valums file uploader and I want to display a file path in textbox after user choosen any file (like with standart file upload). Is there any possible solution to achieve this?
No. Based on my research I've found numerous posts suggesting that browser security features prevent objects from knowing the file system until the appropriate submit action is invoked.
Furthermore they suggest that if you do want to display the full path you'll need a non-browser solution like a java plugin (possibly even a flash object could do it).

Resources