S
S
Sergey2012-06-21 21:50:22
PHP
Sergey, 2012-06-21 21:50:22

A few questions about file hosting programming, can you help?

I am programming a file hosting service to restore gaps in knowledge and learn a lot of new things.

Gentlemen, again a lot of questions:

1. How to force the user not to look, but to download a picture, text, when clicking on a link? How is it done in google mail, for example.
2. I have not found a way to check the file size before uploading to the server, selected via the html file input (form). The method recognized as the solution in the last question , it turns out, does not work in all browsers.
3. How to add the value of a variable to the clipboard in javascript, jquery? Is it possible?
4. Is it possible to somehow implement the scale of the process of uploading a file to the server through javascript, jquery? Or just flash and similar technologies like silverlight?

I want from you not a ready-made code, but manuals, solutions and suggestions, what to google, read.
Thanks to.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
@
@antoo, 2012-06-21
_

1. headers:
Content-Description: File Transfer
Content-Disposition: attachment; filename=image.jpg
Content-Type: application/octet-stream
2, 4: Use the jQuery File Upload plugin , most importantly check on the server, because 100% client-side check cannot be implemented.
3. Usually this is done through Flash, not all browsers support it. Ready-made solutions for example here: code.google.com/p/zeroclipboard/ + JS plugin: www.steamdev.com/zclip/

S
SerDIDG, 2012-06-22
@SerDIDG

2. Larger files can be checked via ActiveX
www.kavoir.com/2009/01/check-for-file-size-with-javascript-before-uploading.html

L
LightSUN, 2012-06-22
@LightSUN

4. PHP 5.4 has a built-in .

V
Vitaly Peretyatko, 2012-06-22
@viperet

4. The nginx function to control the progress of the upload wiki.nginx.org/HttpUploadProgressModule
You can also use the X-Accel-redirect nginx function for controlled file downloads for the exchanger

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question