|
-
Dec 20th, 2005, 07:13 AM
#1
Thread Starter
Fanatic Member
-
Dec 20th, 2005, 11:55 AM
#2
Re: The filename of this image
What are you trying to do with your C# program? You can send the filename along with the file when it is uploaded in the HTTP request. Have a look in my signature at the winsock file upload to see how it's consturcted.
-
Dec 20th, 2005, 11:59 AM
#3
Thread Starter
Fanatic Member
Re: The filename of this image
No actually downloading it, I am trying to figure out how my browser magically knows its filename when I rightclick->save.
It couldn't be inbedded in the image right? Hopefully that's not it, I'm hoping the info is in the response somehow.
"so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman
-
Dec 20th, 2005, 12:12 PM
#4
Thread Starter
Fanatic Member
Re: The filename of this image
These are all the headers I am getting, the Content-Disposition - wich you are using to indicate the filename in your program - is not given.
Code:
Transfer-Encoding
chunked
Content-Type
text/html; charset=ISO-8859-1 (it doesn't even say it's an image??)
Date
Tue, 20 Dec 2005 17:20:53 GMT
Server
Apache/2.0.48 (Linux/SuSE)
Thank you for your attention
"so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman
-
Dec 20th, 2005, 12:18 PM
#5
Re: The filename of this image
The file name is contained in the HTTP response from the server in the Content-Disposition header. This for example is the HTTP response sent when I download an attachment from the Chit Chat forum.
Code:
HTTP/1.1 200 OK
Date: Tue, 20 Dec 2005 17:16:55 GMT
Server: Apache
Cache-control: max-age=31536000
Expires: Wed, 20 Dec 2006 17:17:03 GMT
Last-Modified: Tue, 20 Dec 2005 13:19:28 GMT
ETag: "43685"
Content-disposition: attachment; filename="2 words story.txt"
Content-Length: 27963
Connection: close
Content-Type: plain/text
-
Dec 20th, 2005, 12:23 PM
#6
Re: The filename of this image
In the case of an image, remember, the image is downloaded separatley and it will contain a header such as:
Code:
Content-Type: image/gif
Content-disposition: inline; filename=avatar_wild.gif
Note the Content-Type, it will be image/jpeg or image/gif if it is an image. If its text/html it will be a web page.
-
Dec 20th, 2005, 12:24 PM
#7
Thread Starter
Fanatic Member
Re: The filename of this image
lol yes, I tested that same file and got this:
Code:
Date
Tue, 20 Dec 2005 17:21:52 GMT
Set-Cookie
RMID=54519c9643a83db0; expires=Fri, 31-Dec-2010 23:59:59 GMT; path=/; domain=.vbforums.com,bbsessionhash=97f327aba51b6c13cb48075bb3a67a7b; path=/; domain=.vbforums.com,bblastvisit=1135099312; expires=Wed, 20-Dec-06 17:21:52 GMT; path=/; domain=.vbforums.com,bblastactivity=1135099312; expires=Wed, 20-Dec-06 17:21:52 GMT; path=/; domain=.vbforums.com
Server
Apache
X-Powered-By
Cache-control
max-age=31536000
Expires
Wed, 20 Dec 2006 17:21:52 GMT
Last-Modified
Tue, 20 Dec 2005 13:19:28 GMT
ETag
"43685"
Content-disposition
attachment; filename="2 words story.txt"
Content-Length
27963
Keep-Alive
timeout=15, max=100
Connection
Keep-Alive
attachment; filename="2 words story.txt"
Indeed it has the disposition header, but the image in this case does not, yet my browser somehow knows it.
"so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman
-
Dec 20th, 2005, 12:25 PM
#8
Re: The filename of this image
Whatever it is you are trying to get, it is not an image. Maybe it has something to do with the fact you need to be logged into to view the page.
-
Dec 20th, 2005, 12:28 PM
#9
Thread Starter
Fanatic Member
Re: The filename of this image
 Originally Posted by visualAd
Whatever it is you are trying to get, it is not an image. Maybe it has something to do with the fact you need to be logged into to view the page. 
Are you saying you cannot see it? Because the link works when I am not logged in.
 Originally Posted by visualAd
In the case of an image, remember, the image is downloaded separatley and it will contain a header such as:
Code:
Content-Type: image/gif
Content-disposition: inline; filename=avatar_wild.gif
Note the Content-Type, it will be image/jpeg or image/gif if it is an image. If its text/html it will be a web page.
How do you mean seperately?
"so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman
-
Dec 20th, 2005, 12:31 PM
#10
Thread Starter
Fanatic Member
Re: The filename of this image
Wait a minute, it does matter, IE didn't load it either.
I have run into this problem before, this link may be a bad example. But I guess I have my answer now: Content-Disposition.
Thanks
"so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman
-
Dec 20th, 2005, 12:32 PM
#11
Re: [RESOLVED] The filename of this image
The link gives me a login page. I didn't look at it until just now.
-
Dec 20th, 2005, 12:34 PM
#12
Thread Starter
Fanatic Member
Re: [RESOLVED] The filename of this image
 Originally Posted by visualAd
The link gives me a login page. I didn't look at it until just now.
I should have double checked before posting, sorry.
"so just keep in mind that fantasy is not the same as realtiy and make sure u remember that wii sports may be fun but u cant count on it as exercise ok cool bye" - HungarianHuman
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|