I'm working on a web page with a file upload form that uploads a file via ajax (with the jquery.form plugin and an updating <progress>
bar). I am using MAMP, and since a file I upload is just being copied from one location on my computer to another, the upload time is too quick to see the progress bar in action, even if the file is huge.
I remember seeing a screencast where the presenter made some change to his local env that slowed down the upload process but the specific screencast escapes me...
You could add a new <input type="file"> whenever you finished uploading the previous files and hide the previous input. This way you keep adding a new input every time you want to add more files and prevent the previous input from being overwritten. And it doesn't require you to use AJAX.
Acceptable file types can be specified with the accept attribute, which takes a comma-separated list of allowed file extensions or MIME types. Some examples: accept="image/png" or accept=".png" — Accepts PNG files. accept="image/png, image/jpeg" or accept=".png, .jpg, .jpeg" — Accept PNG or JPEG files.
The <input type="file"> defines a file-select field and a "Browse" button for file uploads. To define a file-select field that allows multiple files to be selected, add the multiple attribute. Tip: Always add the <label> tag for best accessibility practices!
You need to install libapache2-mod-bw
Then in your virtualhost config set:
<virtualhost *:80>
...
BandWidthModule On
ForceBandWidthModule On
BandWidth all 80000
</virtualhost>
This will set a 80 KB/s limit on uploads.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With