views:

63

answers:

2

Is it possible to make a upload progress using javascript only? (maybe with some ajax to a server-side code)

Having a form such as

<form method="post" action="upload.html" enctype="multipart/form-data">
<p>Select file to upload: <input type="file" name="selected_file"></p>
<p><input type="submit" value="Upload the file"></p>
<div id="progress"></div>
</form>

I want to display things as upload progress, speed, total size.

I don't want tools for it, I want to understand how it is done without flash, and from scratch.

Similar questions (none from scratch):

+1  A: 

I see now what you mean by "from scratch". I know of no way to do this that doesn't require some server-side fiddling.

If you have access to PHP 5.2 and can install additional modules, I think this is the closest you'll get regarding a step-by-step process:

What's new in PHP V5.2, Part 5: Tracking file upload progress

It requires APC but as I said, there is no "pure" PHP / Ajax solution as far as I know.

This question contains a number of additional interesting resources.

Pekka