473,396 Members | 2,111 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

HOW-TO: Response.BinaryWrite JPG *WITH* the original filename

DAC
Hello.
How can I Respose.BinaryWrite a file but preserving the original filename.

Explaining better:
Suppose a webform that displays images stored on my database. The page
shows, say, 5 pics at a time.
I want the user to be able to right-click over a pic and use "Save Picture
As..." from IE.
But, since the image is "BinaryWritten", the user gets the filename of my
image generator page. I want to force IE to use the original name for the
pic I have stored in my DB.

Besides Context.Response.ContentType = "image/jpg", is there any other
header I have to set?

Thanks in advance,
Daniel
Nov 17 '05 #1
1 5295
This line of code should do the trick:

Response.AddHeader("Content-Disposition","inline;filename=myname.jpg");

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"DAC" <tecnolog> wrote in message
news:uN**************@TK2MSFTNGP09.phx.gbl...
Hello.
How can I Respose.BinaryWrite a file but preserving the original filename.

Explaining better:
Suppose a webform that displays images stored on my database. The page
shows, say, 5 pics at a time.
I want the user to be able to right-click over a pic and use "Save Picture
As..." from IE.
But, since the image is "BinaryWritten", the user gets the filename of my
image generator page. I want to force IE to use the original name for the
pic I have stored in my DB.

Besides Context.Response.ContentType = "image/jpg", is there any other
header I have to set?

Thanks in advance,
Daniel

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Tom Szabo | last post by:
Just wandering how can you close a browser remotely. In some web applications the browser closes or refreshes periodically. How is that done and how can it be done through PHP? TIA, Tom
15
by: Reid Nichol | last post by:
Hello, I was wondering if I could control how many bytes are in an int and the byte order. In C/C++ I can use int32 but how do I do this in python? How can I control byte order?
4
by: James Salisbury | last post by:
Hi, I was checking my parent's website salisbury.cabrera.net on google by entering villa rent spain cabrera I can see the required site, ranked at 4, but I am concerend by the return at 1 and 5...
4
by: | last post by:
Developing, building, and testing. How do it the best? Learning from the world leader - Microsoft I'm very interested in how the developing/build/testing workflow @ Microsoft looks like. I...
4
by: Supra | last post by:
in vb6 listbox1.remove item 5 how will i do in vb.net? regards
3
by: dba2adm | last post by:
The SNAPSHOT_STATEMENT table function gives the CPU used rows read etc information. How do I know the total number of time the particular statement was executed (as in snapshot_dyn_sql's...
2
by: flywave | last post by:
hi,who can help me ?i came into a problem that how can i get a packet which was send in the LAN.in a word ,how the sniffer works. I once used the rawsocket in win2000 or xp,and it do catch. but...
1
by: nicksop | last post by:
How can i change of a setup project in vb .net For example how can i change the path of C:\program files\myprogram\program.exe and make it D:\program files\myprogram\program.exe
7
by: anushhprabu | last post by:
#define q(k)main(){ return!puts(#k"\nPRABUq("#k")");} q(#define q(k)main(){return!puts(#k"\nq("#k")");}) guys i'm working on this code.. i got it fromnet.. how this is working.. anyone pls.....
2
by: belred | last post by:
i just read this blog about how many objects (types) are loaded for a hello world program in C#. http://blogs.msdn.com/abhinaba/archive/2008/09/15/how-many-types-are-loaded-for-hello-world.aspx ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.