login about faq

Greetings...

i am facing a problem..

i need to get file size by using chilkat HTTP object. but it returns false value ..

this is an example url:

https://fbcdn-video-a.akamaihd.net/hvideo-ak-ash2/v/1242398_10202245220513615_760711674_n.mp4?oh=e991d6f3b61802c62b1139cbeea424f0&oe=527C8587&__gda__=1383890791_8af355f54d6a3339084e1679c168fa30

Internet download manager shows file size is 6.27MB..

but chilkat HTTP object return 176/174 bytes (sometimes 174 and sometimes 176) bytes only :(

why?

P.S i use following code to get file size:

http://example-code.com/vb/http_getDownloadSize.asp

any help would be highly appreciated :)

thanks in advance..

best regards

asked Nov 07 '13 at 23:27

mAlam's gravatar image

mAlam
991215


so, no helps?

link

answered Nov 08 '13 at 20:46

mAlam's gravatar image

mAlam
991215

I tried the download link, but I get the following error:

An error occurred while processing your request.

Reference #50.9cf354b8.1384025497.be01f42

This is just a guess, but I see that the link is to a video via a CDN - it's possible that either there is a redirect going on in the browser that CKHTTP isn't following, or there's an intermediary file format that is only 176ish bytes, that contains the actual link to the video (and the browser figures this out and follows it, but not CKHTTP - IIRC some WMV files are like this).

When you download the 176 byte, what are its contents?

(Nov 09 '13 at 14:36) jpbro ♦

Interestingly enough the length of that error message is 180 bytes (pretty close to the 176/178 you are getting). Maybe CKHTTP is getting the error, while your browser is getting the file? What browser are you using?

(Nov 09 '13 at 14:37) jpbro ♦

@jpbro, dear sir, the link is direct link.. and i am not using browser i am using IDM (internet download manager that shows the file size correctly). If there was a redirect IDM change the address as redirects goes but there is not redirection. and also i have set Chilkat HTTP.followredirects=1 but same results..

about the link: that link is a static. That means after generation the link will be valid only for 1 hours. So, when you are online and can check the link within 1 hour, please knock me. I will regenerate the link

Note: Sir, even with MS Sock component i get the file size correctly.

(Nov 09 '13 at 21:35) mAlam

Don't send me a new link yet, because I am going to bed soon, but let's try tomorrow.

In the meantime, if you still want to test things, does it work if you use MimicIe = 1?

(Nov 09 '13 at 23:17) jpbro ♦

@jpbro, thanks for your reply sir.. yes i will wait for your tomorrow but sir, remember my time format is GMT+6.00 and normally online from 7am to 11pm ..

thanks in advance.. best regards

(Nov 09 '13 at 23:19) mAlam

I'll do my best tomorrow, but remember my time format is GMT-5.00. This just about puts us at opposite ends of the earth, so we'll see how this goes with a 1 hour time limit on the link! Is there any way you can extend the time limit of the link?

(Nov 09 '13 at 23:28) jpbro ♦

here is the link: https://fbcdn-video-a.akamaihd.net/hvideo-ak-ash2/v/1278194_10202241353856951_342991444_n.mp4?oh=f5a04c15b3af01f4f7a524ef3717e8a7&oe=527F24F5&__gda__=1384063829_a664de067bd0bfceaeaa4e7c68379c20

see if you can check now or i will do tomorrow again..

and i am sorry, as that was a third party service so, i can't extend the time :(

(Nov 09 '13 at 23:32) mAlam

I can take a look at it now if you can send me a new link.

(Nov 10 '13 at 20:19) jpbro ♦

i am sorry for the delay. i was away.. however can you do now?

(Nov 10 '13 at 22:51) mAlam

Yes, I can try now.

(Nov 10 '13 at 23:03) jpbro ♦
showing 5 of 11 show all

Hi,

I just tried it and I am getting the correct file size. This code:

Sub TestHttp()
  Dim lo_Http As ChilkatHttp
  Dim lo_HttpResp As ChilkatHttpResponse

  Set lo_Http = New ChilkatHttp
  lo_Http.UnlockComponent "UnlockCode"

  Set lo_HttpResp = lo_Http.GetHead("https://fbcdn-video-a.akamaihd.net/hvideo-ak-ash2/v/1278194_10202241353856951_342991444_n.mp4?oh=a66ad318d4dc65fe491246e0bdc41485&oe=52807675&__gda__=1384150229_da98ed2789396651a6dc644c41e97310")
  Debug.Print "File size in bytes: " & Format$(lo_HttpResp.GetHeaderField("Content-Length"), "#,##0")
End Sub

Produces the following result for me:

File size in bytes: 6,560,454
link

answered Nov 10 '13 at 23:20

jpbro's gravatar image

jpbro ♦
1.1k2618

i don't understand my code still return 175 bytes.. then i try. your code and it also returns 175 bytes :(

any suggestion? :(

(Nov 10 '13 at 23:32) mAlam

Couple of thoughts:

1) Are you using the latest version of the ChilkatHTTP object (9.4.1)?

2) What result do you get if you call:

Debug.Print lo_Http.QuickGetStr("https://fbcdn-video-a.akamaihd.net/hvideo-ak-ash2/v/1278194_10202241353856951_342991444_n.mp4?oh=a66ad318d4dc65fe491246e0bdc41485&oe=52807675&__gda__=1384150229_da98ed2789396651a6dc644c41e97310")?
(Nov 10 '13 at 23:39) jpbro ♦

Also, after you call Set lo_HttpResp = lo_Http.GetHead, what result do you get if you call the following:

Debug.Print lo_HttpResp.Header

Please post the results here.

(Nov 10 '13 at 23:40) jpbro ♦

sir, that call return as 3.2mb files (i saved the result to a file)

(Nov 10 '13 at 23:46) mAlam

Well, unfortunately I'm not sure what could be wrong (although 3.2MB is about half the size that I get, it sounds like QuickGetStr is at least getting a file).

Are you actually using the 9.4.1 version of ChilkatHTTP?

Can you post the results of lo_HttpResp.Header?

(Nov 11 '13 at 00:00) jpbro ♦

sir, may i have your email address? if so, then can you send me your email address in PM (private message)?

(Nov 11 '13 at 02:14) mAlam

Hi mAlam - I'd prefer to keep the conversation here at the forum. It has the benefit of helping other users who might be having the same problem once we find a solution, and it also means that Chilkat can see the thread and possibly contribute if he sees anything that he recognizes as the source of the problem.

(Nov 11 '13 at 06:49) jpbro ♦

thanks sir, but i need to talk about something that is private.. :(

is that possible? if not then no problem but hope so :)

(Nov 11 '13 at 06:54) mAlam

I don't see any mechanism for private messages in this forum to send my email address. Are you a member at vbforums.com? If so, PM me there. My username is the same there as here.

(Nov 11 '13 at 07:08) jpbro ♦

yes i do have account there and my id there is "Shohag_ifas" (without quotation mark)

(Nov 11 '13 at 10:45) mAlam
showing 5 of 10 show all

Hi mAlam,

There are 2 important things that have not been answered:

  1. Are you using ChilkatHTTP 9.4.1? If not you should update and try your code again, the problem may have already been fixed.
  2. Can you post the results of the Header property of the ChilkatHTTPResponse object immediately after your call the GetHead method of the ChilatHTTP object?

Thanks.

link

answered Nov 11 '13 at 06:51

jpbro's gravatar image

jpbro ♦
1.1k2618

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×35
×5

Asked: Nov 07 '13 at 23:27

Seen: 22,992 times

Last updated: Nov 11 '13 at 10:45

powered by OSQA