Coffeehouse Thread

16 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Charles: Sandbox question

Back to Forum: Coffeehouse
  • User profile image
    jsrfc58

    What is the upper limit for apps in terms of size for the Sandbox forum? Just curious.

  • User profile image
    Steve411

    around 4 mb i believe.

  • User profile image
    Loadsgood

    jsrfc58 wrote:
    What is the upper limit for apps in terms of size for the Sandbox forum? Just curious.


    Test it and find out Wink



    That's my motto.
    Loadsgood.

  • User profile image
    Steve411

    haha

  • User profile image
    Charles

    Good question. What should it be?

    C

  • User profile image
    Maurits

    9 MB

  • User profile image
    Loadsgood

    50mb I don't know why but that is the limit that comes to my mind. As well as a limit to the amount a user is allowed to upload (so that they don't just keep uploading 50mb projects over and over again).



    Maybe less, maybe more.
    Loadsgood.

  • User profile image
    Sven Groot

    42MB, for obvious reasons. Tongue Out

  • User profile image
    sbc

    Won't there be a problem if it is set too high? Server timouts etc. HTTP doesn't handle big uploads that well. (S)FTP is better suited for that.

  • User profile image
    Maurits

    Too bad javascript doesn't let you access the size of a file chosen in an <input type="file"> - if it did the following quirky social-engineering solution has occured to me

    function bytes2MB(bytes)
    {    return bytes / 1024 / 1024;
    }
    
    function MB2bytes(mb)
    {    return mb * 1024 * 1024;
    }
    
    function validate(form)
    {
         // .fileSize doesn't really exist, but it would be nice
        var size = bytes2MB(form.uploadfile.fileSize);
    
        for (var warnlimit = 10; size > warnlimit; warnlimit += 5)
        {
            if (!confirm(
                "Your file is more than " + warnlimit + "MB - " +
                "are you sure that you need that much space?"
                )) { return false; }
        }   
        return true;
    }
    

    <form onsubmit="return validate(this);">
    ...
    <input type="file" name="uploadfile">
    </form>
    

  • User profile image
    Jeremy W

    Maurits, ASP.NET could do this. JS couldn't. You can check the size of a file quite easily in any server side technology (pre-upload) Smiley

  • User profile image
    Maurits

    Really? (raising-eyebrow smiley...)
    Researching this provocative claim brings something else to light - ASP.NET will store the entire uploaded file in RAM while processing the request.  Charles, you might want to bear this in mind when setting the upload file size limit - avoid allowing people to upload files bigger than the total RAM on a typical cluster member.

    Still researching the "size of file before upload" claim - are you referring to checking the Content-Length header, perhaps?

    Oh, and there's a default limit of 4MB you'll have to unset too...
    This quote seems appropriate:

    KB 295626 wrote:

    (from kb)
    With regular traffic of files being uploaded, Microsoft recommends that you use a maximum file size in the range of 10 to 20 megabytes (MB). If you rarely upload files, the maximum file size may be 100 MB

  • User profile image
    Jeremy W

    If the file has Content-Length set that'll work, but that's really a utopic kind of expectation. I haven't done filesystem work in a while, but I'm fairly sure you can check the actual properties of the file in question (it's probably something incredibly optic).

    I wouldn't classify myself as a developer anymore, but we used to have to store masses of images in databases, and I wrote a similar program in ASP 2.0, as well as iHTML back in the day to do just what you're saying.

  • User profile image
    Charles

    The ASP.NET default maxRequestLength is 4 MB. That's about as big as it will remain for Channel 9. I am flexible, but will not consider adding support for huge file uploads (for obvious reasons I hope).

    C

  • User profile image
    Maurits

    Client-side, there's a proposal in RFC 1867 to have <input type="file" maxlength="n"> limit the user to files of n bytes or less.  Makes sense to me.  Dave Massy, could this be implemented in IE 7 or IE 7.x?

    RFC 1867 wrote:

    If the INPUT tag [with type="file"] includes the attribute MAXLENGTH, the user agent should consider its value to represent the maximum Content-Length (in bytes) which the server will accept for transferred files.


    Or is it already implemented?

    Maybe not... there's a good justification here to not implement it.

  • User profile image
    jsrfc58

    Works for me.

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.