Linked Questions
13 questions linked to/from Content-Length header with HEAD requests?
21 votes
7 answers
92k views
Content-length and other HTTP headers?
Does it give me any advantage if I set this header when generating normal HTML pages? I see that some frameworks out there will set this header property and I was wondering why... (Along with other ...
2 votes
2 answers
15k views
force to download a remote file via curl or other method
I have a remote link from which I want to force download a file. Right now I am using cURL. My script works for this url (as I tested a different one): http://images.mob.org/iphonegame_img/...
6 votes
4 answers
9k views
Javascript check file size
Is it possible to keep checking with javascript if the filesize of a file on a webserver (e.g. http://www.mysite.com/myfile.js) is larger than 0 bytes and if so return a true or false value? Thanks ...
7 votes
3 answers
43k views
Calculating Content-Length with Python
I'm trying to make a post, however each time I did it, I would get a 411 response error. I'm using the requests library in python. In [1]: r.post(url) Out[1]: <Response [411]> So then I ...
13 votes
2 answers
2k views
Why Tomcat returns different headers for HEAD and GET requests to my RESTful API?
My initial purpose was to verify the HTTP chunked transfer. But accidentally found this inconsistency. The API is designed to return a file to client. I use HEAD and GET methods against it. ...
1 vote
1 answer
2k views
Using C#, how can I detect if an Image URL returns something different from a default image?
I have some code that is using the solution from this question to validate that a certain image url exists. So I have code that looks like this: private bool PictureExists(string id) { ...
-1 votes
1 answer
1k views
Check the file size before downloading C# [duplicate]
can someone tell me how I can check filesize before downloading from page www. example I have file .rar in www.mypage.pl/users/programs/program.rar And I can download only with ftp but I want first ...
0 votes
1 answer
760 views
How to get the loaded size of a Page using only JS [closed]
Hy I would like to build a load bar when my site is loading. To do it I need to know how to get the entire file size witch must be loaded and the actual file size witch has already been loaded, to do ...
0 votes
0 answers
1k views
How to get file size if content-length does not exist?
I have a file I'd like Python to find out and print its file size. Unfortunately, the headers do not have the key content-length. Is there a workaround to finding the file size without content-length? ...
2 votes
1 answer
656 views
Why does Rails render templates for HEAD requests?
For HEAD requests, Rails seems to perform all the usual steps including rendering templates and then discards the respective output (sends back an empty response). I can't think of any way that ...
0 votes
0 answers
611 views
Is it possible to get the content-length of a web page if the server doesn't include content-length as a header?
Is it possible to get the 'content-length' of a web page if the server doesn't include content-length as a header (even if the whole page is downloaded) without downloading the whole content? I am ...
0 votes
1 answer
608 views
Determine Audio File Length if Audio Tag src load fails Javascript
ok so i did some research and it seemed the best way to determine the length of an audio file with javascript is to create an <audio> tag, set the file path to the src attribute, append the ...
0 votes
0 answers
117 views
Why is event.total in XMLHttpRequest always 0, unless Content-Type is PDF?
I tried various days to make a progress bar for my download, a task which I expected to be quite trivial. Everything seemed to to be just right, but the event.total-value was always 0 (or undefined in ...