views:

153

answers:

4

I am programming a control to allow the users of our intranet to upload multiple files into our system, but with some added functionality.

Imagine you as a user are uploading N files, when you add N files the intranet presents you a list like this:

File_name_1 ..... [View] [Remove] [Upload]
File_name_2 ..... [View] [Remove] [Upload]
.
.
.
File_name_n ..... [View] [Remove] [Upload]

[Remove all file] [Upload all files]

If you clic on the View button the file named "file_name_X" will be opened so you can review it and be sure it really is the file you want to upload.

Is this possible?, I am new on the Web programming world and all I found suggest the browsers do not allow you to access local file system from inside a web, but I am not sure.

+7  A: 

One way to do this is that you actually upload initially but you only upload it to a "Staging" area. Thus it wouldn't have actually been committed to your system.

This is what Gravatar does which uploads the file and then lets you crop and adjust the image before saving it.

The only other way I've seen this done is using an ActiveX control for example in IE or some other browser extension mechanism.

JoshBerke
We upload to a staging area (be careful of filename clashes). You may need to modify your web config to allow the data to be saved between postbacks.
ck
+1. A staging area is wise anyway, preferably one outside the web realm. You can print the actual image from a script delivering the Content-type: image/jpeg (for example), when showing it to the client. Once it's committed, rename it (move it) to its permanent location, if you are storing the image that way. Be careful to test and, modify if necessary, names given by the web user.
Fran Corpier
+2  A: 

Uploading files while presenting a good user interface, including progress reporting about the upload, is hard.

I suggest the Yahoo UI uploader widget: http://developer.yahoo.com/yui/uploader/

It's also the basis for the Flickr uploader, see the YUI blog post: http://yuiblog.com/blog/2009/02/26/flickr-uploadr/

Larry

Larry K
It seems to be a good option, but we need something that do not use anything else than HTML an Javascript.
Doliveras
A: 

In IE the file input type will put the full path in the value attribute.

Hexxagonal
In previous versions of IE this was true, but IE, like Firefox and the rest of browsers are now omitting this information to prevent malicious code to access the file system of the user.
Doliveras
This is determined by a browser setting, since this is an intranet situation I'm assuming they have full control over the browser.
Hexxagonal
A: 

give me the source coad to save our uploding file in our intranet site because i know very well how to upload but i can not save this file.

nisha