tags:

views:

273

answers:

2

Hi,

Is there any good control or plug-in for uploading multiple photos with preview? As far as I understand it is impossible to preview photo on local computer using just JavaScript. So it has to use Flash or Java.

Thanks, also, I use ASP.NET.

A: 

You could also make use of silverlight 4. If you're looking for something already written you might try using the upload control from gallery which much require some hackery or if you have money to burn then telerik have an upload control but I don't believe it supports previews. This http://www.aurigma.com/Products/ImageUploader/ also looks nifty.

stimms
Thanks, but I don't think I will consider a SL based solution in this project.
sean717
+1  A: 

Wait, do you mean show it in a browser window before starting the upload? So does the file have a URI? (Hint: file:///c/users/public/somefile.png is a URI) You can always just link it into an image tag on their browser session.

Now, will a browser let you link a file:/// for image? That I've not tried, but you should; at least you'll learn something from it when you do try.

But using this, there's no reason you can't use a lightbox style image viewer with the local URI.

drachenstern
thx, I will try that.
sean717
Cool, let me know how it works. If you're having issues with it, post back, we can try another tack. Otherwise, I should think this would work.
drachenstern
Hey, I don't think it is possible to display a local image before uploading it to server.
sean717
I disagree. It's only a matter of getting the handle to the file. It's entirely possible, although browsers may complain. However, I was trying to focus on it is technically possible. Ref: http://jquery.tiddlywiki.org/twFile.html http://www.fyneworks.com/jquery/multiple-file-upload/
drachenstern
But yes, most people will tell you that accessing client files is not permitted. Somehow those people overlook the actual act of uploading files to webservers. jQuery can even handle the upload via ajax and cancel before sending to the server (so you may not read the whole file, but I'm just looking at concepts at the moment)
drachenstern
I tried the "jquery.tiddlywiki.org/twFile.html" link and yes my browser displays warning. That is unacceptable for me for the project I am working on.I guess I will scrape the idea of previewing for now, and use a jQuery plugin for multi-file upload. besides the one you posted, "Uploadify" seems to be a good choice, have you used that one?
sean717
As for the warnings, there are ways to avoid the warning, but I might be thinking of 5 years ago tech, things may have closed around what I'm thinking is an option. Additionally, depending on the deployment scope of this system, the users could "trust" your server. Once again, factors decide.
drachenstern
No I haven't personally used uploadify or the one I linked. Was actually just pointing at "get the file handle without pushing to the server" concept. But had a feeling it was where you would be headed.
drachenstern