File Upload

S

shapper

Hello,

I need to upload a file. Can I only do this with the File Upload
control?

I also need the following:

- Send upload info, upload percentage, continuously to a JavaScript
function so I can display the Upload Progress.

- The controls would be inside an Update Panel.

Before I start to upload a file I send data to a database. This is
done.

After the data has been inserted in database the file upload would
start.

The Upload Panel would "finish" when the file finishes upload.

Is this possible?

Could I get some help on this?

Thanks,

Miguel
 
A

Anthony Jones

shapper said:
Hello,

I need to upload a file. Can I only do this with the File Upload
control?

I also need the following:

- Send upload info, upload percentage, continuously to a JavaScript
function so I can display the Upload Progress.

Unfortunately there is currently no support in browsers to support this.
You would need an extra component installed on the client that can handle
the upload and provide a means of displaying a progress bar (typically a
progress event that can be consumes by the sites Javascript).

- The controls would be inside an Update Panel.

Before I start to upload a file I send data to a database. This is
done.

After the data has been inserted in database the file upload would
start.

What happens if the upload fails? Do you need to reverse out the DB changes?

Consider uploading to a temporary location first, then a post to the server
can update the database and move the file from its temporary location to its
persistent location in a more atomic operation. If the upload fails, you've
not got rubbish in your DB that you need to clear up.
The Upload Panel would "finish" when the file finishes upload.

Is this possible?

Without client side component support the only way to upload a file is via a
Form post from the browser. Unfortunately Form posts were never intended to
carry large amounts of data and therefore no thought has been given to
providing the user with progress info on the upload.

If you're desperate then you might get away with performing the Form post
from a page in an IFrame, you could have a progress bar in the host page
polling the server and retrieving the size of the temporary file. I'm not
entirely sure how you would retrieve the expected final size of the file
though (I'm not familiar with the file upload control where you might expect
to get that info, I use a client side component instead).
 
J

Jevon

I've previously come across (but not yet used)
http://www.brettle.com/neatupload - have you seen this yet? I have no idea
if it can be used with an UpdatePanel, but I think it does the other stuff
you mention.

I agree with Anthony though, ideally you shouldn't be updating anything in
the database until you have the file on the server to work with.

Jevon
 
I

Ilyas

I've previously come across (but not yet used)http://www.brettle.com/neatupload- have you seen this yet? I have no idea
if it can be used with an UpdatePanel, but I think it does the other stuff
you mention.

I agree with Anthony though, ideally you shouldn't be updating anything in
the database until you have the file on the server to work with.

Jevon















- Show quoted text -

Telerik have a file upload control which can do exactly this
See http://www.telerik.com/products/aspnet/controls/upload/overview.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Upload XLSX file 7
File Upload Folder Permissions 5
Upload and server FTP 2
Upload a file to a different site 3
FTP Upload 12
AJAX file upload 4
File Upload in Business Layer 2
Moodle 2.8 upload SCORM file problem. 0

Top