Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB6 url Download
I have a problem for download a file from a URL, via VB6. The link is like this. All of the server, are similar:
 
https://www.inforis.org/nuevo_ris/download_file.php?token=54cf5c32931c08ee9c03cd01ab5ea156&id=7394
 
I can download it using simple Inet Download function, but can´t get de filename. The server gives me only this Headers of the file:
 
HTTP/1.1 200 OK
Date: Tue, 15 Jan 2013 19:14:23 GMT
Server: Apache/2.2.16 (Debian)
Last-Modified: Wed, 09 Jan 2013 22:59:15 GMT
Etag: "400ae-1bd39a-4d2e302e7d6c0"
Accept-Ranges: bytes
Content-Length: 1823642
Keep-Alive: timeout=15, max=99
Connection: Keep-Alive
Content-Type: application/pgp-signature
 
But no the name, or the Location
Can anyone help me, please?
 
Thanks
Posted 15-Jan-13 9:57am
Comments
Sergey Alexandrovich Kryukov at 15-Jan-13 15:31pm
   
Why do you think you need such a name?
—SA
Master.Man1980 at 15-Jan-13 16:00pm
   
Sir.I can't find you from http://www.codeproject.com/script/Membership/Profiles.aspx. Where you @?
Master.Man1980 at 15-Jan-13 17:03pm
   
It's a codeproject who's who page(Codeproject>Community>Who's who). You are not shown there. Something must be wrong

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

The URL and related content you receive via HTTP response is not associated with any particular file name. The resources obtained on the client side via the HTTP protocol do not have to be mapped on any file system. You can use any valid file name you like.
 
[EDIT]
 
As to the HTTP header "Location", please read:
http://en.wikipedia.org/wiki/HTTP_location[^],
http://tools.ietf.org/html/rfc2616[^].
 
It may or may not be there. Please see also my comments below.
 
—SA
  Permalink  
v3
Comments
Sergey Alexandrovich Kryukov at 15-Jan-13 15:48pm
   
It may have a name, so what?
 
The resource may or may not have the name and correspond to a point of the file system of the host executing HTTP server. Such mapping or even one-to-one correspondence may exist, but it does not have to, for a very, very good reason. That's why you cannot see a file name in your headers. HTTP is fully free from mapping between URLs and server-side file names. The client side application should not rely on any assumptions on such mapping. Again, this is done for good, not for evil.
 
Just reconcile yourself with that fact, that's all you can do.
 
—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 5,170
1 DamithSL 4,357
2 Maciej Los 3,750
3 Kornfeld Eliyahu Peter 3,470
4 Sergey Alexandrovich Kryukov 2,851


Advertise | Privacy | Mobile
Web04 | 2.8.141216.1 | Last Updated 15 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100