I'm focusing on an internet application which assists file uploading. I'm already familiar checking the dimensions in server side, however i wanted to determine the quality inside a client side.

I understand its a browser limitation that people cant access the file qualities for security reasons. And so i have attempted both swfupload and uploadify component. Both of them are good and serve the requirements.

However the limitation is both is dependent on expensive, therefore if my consumer not installed expensive i quickly would finish up inside a problem. Asking these to install expensive is yet another factor, nevertheless its an internet portal and also the users list is big. And so i don't like the thought of asking these to install expensive.

Today i discovered file upload functionality in gmail. And examined this in browser(IE) without getting expensive installed. Things i found was interesting. Should you upload a large file, they provided a postback and immediately coming back the content the quality is simply too large.

How you could do, how they may find how big the file without installing the entire content.? In my opinion this must be carried out by reading through HTTP header info. am i right?

Making this the precise functionality i needed to implement. When the expensive is installed already, i'm able to use uploadify to determine the size otherwise might be i ll implement-the-never-heardof-technique-used-by-google.

can someone recommend me how to get this done?

anybody faced the same problems earlier, whoever else done??

Update:

Gmail upload with expensive set up in FF

alt text

without expensive in IE

alt text

Cheers

You might have a look in the File API the industry draft for HTML 5. Here is a nice article. That is what Gmail uses when the browser supports it obviously. There is however not a way to make sure this works across all browsers.

In IE, it can be done with JS and ActiveX:

function A()



</script>

</mind>

<body>

<form title="a">

<input type="file" title="b">

<input type="button" title="c" value="SIZE" onClick="A()">

</form>

</body>

</html>

I really requested this very question (pretty much) a couple of days ago and also the general answer appears to become: It cannot be achieved.

For reference: Ensure quality of submitted file is gloomier than maxRequestLength prior to the upload happens?

You could have the next Code to obtain Gmail feature:

<html>

<head>

<script type="text/javascript">

$(function()

opera,chrome.

   if (input.files[].fileSize > MAX_FILE_SIZE) quality exceeded")

         return false

      

 

else



catch(e)





)

)

)

</script>

</mind>

<body>

<form method="publish" enctype="multipart/form-data" title="fileUpload" action="Default.aspx" target="responseFrame">

<input type="file"/>

<input type="submit" value="upload" id="btnSubmit"/>

</form>

<iframe src='' title='responseFrame' id='responseFrame' style='width:0pxheight:0pxborder:0'></iframe>

</body>

</html>

Hope this help.

I've not examined this, but is not there a "Content-Length" header around the request? It'll include not only the file being submitted, but technology-not only like a benchmark to find out when the Publish is simply too large to deal with.