Welcome Guest Search | Active Topics | Sign In | Register

Uploader - file size Options
Paul Creedy
Posted: Thursday, April 17, 2008 5:28:57 AM
Rank: Advanced Member
Groups: Member

Joined: 6/5/2007
Posts: 76
Is it possible to get the file size of the uploading file before it has fully uploaded?

What I want to do it restrict the uploaded file size as much client side as possible, not let them wait ages for the upload just to be told the file is too big.

If so could you point me at an example?
eo_support
Posted: Thursday, April 17, 2008 6:46:44 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Hi,

The uploader can restrict the file size for you:

http://www.essentialobjects.com/ViewDoc.aspx?t=EO.Web.AJAXUploader.MaxDataSize.html

Thanks
Paul Creedy
Posted: Thursday, April 17, 2008 7:01:12 AM
Rank: Advanced Member
Groups: Member

Joined: 6/5/2007
Posts: 76
Is the filesize tested before upload at client side or after upload on server side?

It's important that I somehow test the file before it's fully uploaded.
eo_support
Posted: Thursday, April 17, 2008 7:27:44 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
There is no way to test the file size on the client side. It's always tested on the server side. The browser first reports the total file size to the server and then starts to transfer the actual file data. As soon as we see total file size is over limit, we abort the upload so the rest is not transferred.

All these are done by the uploader itself, so it has nothing to do with your code.
Paul Creedy
Posted: Thursday, April 17, 2008 7:55:07 AM
Rank: Advanced Member
Groups: Member

Joined: 6/5/2007
Posts: 76
Thanks

As long as the test is done soon after upload starts so that it can be aborted rather than the whole file being uploaded before being aborted then that's fine.

Am I right in thinking that the file size is reported to the server before all the file is uploaded? How much would be uploaded if any before the file size could be determined? I'm just trying to determin the wait the user would have before being informed the file is too big.
eo_support
Posted: Thursday, April 17, 2008 8:23:13 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
Yes. The file size is in the HTTP headers and the content is in the HTTP form data. The header arrives first --- that's the purpose of having a header.

Note that sometimes other modules before us would read the whole contents before hand anything over to us. For example, if you have a tracing module, it would read the header, read the form data, do some of its own work, then pass the header and data to us. In that case we still get the header first, but somebody before us has already gotten the whole data, so the header arrives us too late. You will see the progress bar freeze and sudenly jumps to 100% in that case. Obviously in this case there is nothing we can do. You will have to remove those modules before us.
Paul Creedy
Posted: Sunday, May 4, 2008 1:06:36 AM
Rank: Advanced Member
Groups: Member

Joined: 6/5/2007
Posts: 76
With a multi line upload, does the max size refer to the total upload or the individual files being uploaded?
eo_support
Posted: Sunday, May 4, 2008 7:08:11 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,194
It's the total size.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.