On my website I have a dynamic link(aspx) to this file 0AX120S.jpg(privacy
protection). When a visitor clicks on the link I want them to see
my_vacation_pic.jpg (fetch realname from database) is this possible with
ASP.NET(C#)?
Thanks
Aaron 14 2105
Yeah of course,
0AX120S could be your primary key in your table and it would include the
link for the real filename in another column. Use SQL to query the filename
from the database.
"Aaron" <ku*****@yahoo.com> wrote in message
news:um**************@tk2msftngp13.phx.gbl... On my website I have a dynamic link(aspx) to this file 0AX120S.jpg(privacy protection). When a visitor clicks on the link I want them to see my_vacation_pic.jpg (fetch realname from database) is this possible with ASP.NET(C#)?
Thanks
Aaron
But how do I output the file as my_vacation_pic.jpg when the actual filename
stored on the server is 0AX120S.jpg
1)the user clicks this link http://mywebsite.com/download.aspx?file=003
2)download.aspx fetch index 003 from database
3)outputs 0AX120S.jpg as my_vacation_pic.jpg
4)the user only knows that hes downloading my_vacation_pic.jpg
Why do I want to do this? well, the user can upload files to my server and i
want them to be downloadable only through the download.aspx script. It also
helps protect the server against malicious scripts that people upload.
Thanks
"Tampa.NET Koder" <an*******@microsoft.com> wrote in message
news:ub**************@TK2MSFTNGP10.phx.gbl... Yeah of course,
0AX120S could be your primary key in your table and it would include the link for the real filename in another column. Use SQL to query the filename from the database.
"Aaron" <ku*****@yahoo.com> wrote in message news:um**************@tk2msftngp13.phx.gbl... On my website I have a dynamic link(aspx) to this file 0AX120S.jpg(privacy protection). When a visitor clicks on the link I want them to see my_vacation_pic.jpg (fetch realname from database) is this possible with ASP.NET(C#)?
Thanks
Aaron
On Sat, 19 Feb 2005 12:55:54 -0700, "Aaron" <ku*****@yahoo.com> wrote: But how do I output the file as my_vacation_pic.jpg when the actual filename stored on the server is 0AX120S.jpg
Hi Aaron:
One way to do this is to use set the src attribute of an image tag to
an ASPX page, and have the ASPX page determine the correct filename to
use and write the jpeg contents back into the response.
Here is an example: http://msdn.microsoft.com/msdnmag/is...e/default.aspx
Hope this helps,
--
Scott http://www.OdeToCode.com/blogs/scott/
Well,
If you display the image to them and they right click on it and let say,
view the properties. Thie image 0AX120S.jpg will not display. They will
see this as the image source http://mywebsite.com/download.aspx?file=003.
If they choose to save your image to disk, then I think they will be able to
call it whatever you want. Hope this helps, otherwise see if anyone else
have a take on this
"Aaron" <ku*****@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl... But how do I output the file as my_vacation_pic.jpg when the actual filename stored on the server is 0AX120S.jpg
1)the user clicks this link http://mywebsite.com/download.aspx?file=003 2)download.aspx fetch index 003 from database 3)outputs 0AX120S.jpg as my_vacation_pic.jpg 4)the user only knows that hes downloading my_vacation_pic.jpg
Why do I want to do this? well, the user can upload files to my server and i want them to be downloadable only through the download.aspx script. It also helps protect the server against malicious scripts that people upload.
Thanks
"Tampa.NET Koder" <an*******@microsoft.com> wrote in message news:ub**************@TK2MSFTNGP10.phx.gbl... Yeah of course,
0AX120S could be your primary key in your table and it would include the link for the real filename in another column. Use SQL to query the filename from the database.
"Aaron" <ku*****@yahoo.com> wrote in message news:um**************@tk2msftngp13.phx.gbl... On my website I have a dynamic link(aspx) to this file 0AX120S.jpg(privacy protection). When a visitor clicks on the link I want them to see my_vacation_pic.jpg (fetch realname from database) is this possible with ASP.NET(C#)?
Thanks
Aaron
Thanks but I not just dealing with image files, also zip, rar, pdf..., that
was just an example.
"Scott Allen" <sc***@nospam.odetocode.com> wrote in message
news:pc********************************@4ax.com... On Sat, 19 Feb 2005 12:55:54 -0700, "Aaron" <ku*****@yahoo.com> wrote:
But how do I output the file as my_vacation_pic.jpg when the actual filename stored on the server is 0AX120S.jpg
Hi Aaron:
One way to do this is to use set the src attribute of an image tag to an ASPX page, and have the ASPX page determine the correct filename to use and write the jpeg contents back into the response.
Here is an example: http://msdn.microsoft.com/msdnmag/is...e/default.aspx
Hope this helps,
-- Scott http://www.OdeToCode.com/blogs/scott/
With your method someone can still figure out the actual location by using a
packet sniffer. It just redirects to that location.
ie. http://mywebsite.com/download.aspx?file=003 redirects to http://mywebsite.com/uploadedFiles/0AX120S.zip
I want this http://mywebsite.com/download.aspx?file=003 gets http://mywebsite.com/uploadedFiles/0AX120S.zip outputs as http://mywebsite.com/uploadedFiles/my_vacation_pic.zip
If they type http://mywebsite.com/uploadedFiles/my_vacation_pic.zip in their
browser they will get a 404 error. There's no way for them knowing http://mywebsite.com/uploadedFiles/0AX120S.zip because that address is not
sent to their computer.
Is this possible??
"Tampa.NET Koder" <an*******@microsoft.com> wrote in message
news:OD**************@TK2MSFTNGP10.phx.gbl... Well, If you display the image to them and they right click on it and let say, view the properties. Thie image 0AX120S.jpg will not display. They will see this as the image source http://mywebsite.com/download.aspx?file=003. If they choose to save your image to disk, then I think they will be able to call it whatever you want. Hope this helps, otherwise see if anyone else have a take on this "Aaron" <ku*****@yahoo.com> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl... But how do I output the file as my_vacation_pic.jpg when the actual filename stored on the server is 0AX120S.jpg
1)the user clicks this link http://mywebsite.com/download.aspx?file=003 2)download.aspx fetch index 003 from database 3)outputs 0AX120S.jpg as my_vacation_pic.jpg 4)the user only knows that hes downloading my_vacation_pic.jpg
Why do I want to do this? well, the user can upload files to my server and i want them to be downloadable only through the download.aspx script. It also helps protect the server against malicious scripts that people upload.
Thanks
"Tampa.NET Koder" <an*******@microsoft.com> wrote in message news:ub**************@TK2MSFTNGP10.phx.gbl... Yeah of course,
0AX120S could be your primary key in your table and it would include the link for the real filename in another column. Use SQL to query the filename from the database.
"Aaron" <ku*****@yahoo.com> wrote in message news:um**************@tk2msftngp13.phx.gbl... On my website I have a dynamic link(aspx) to this file 0AX120S.jpg(privacy protection). When a visitor clicks on the link I want them to see my_vacation_pic.jpg (fetch realname from database) is this possible with ASP.NET(C#)?
Thanks
Aaron
On 19 Feb 2005, "Aaron" <ku*****@yahoo.com> postulated in news:
#G**************@tk2msftngp13.phx.gbl: Thanks but I not just dealing with image files, also zip, rar,
pdf..., that was just an example.
"Scott Allen" <sc***@nospam.odetocode.com> wrote in message news:pc********************************@4ax.com... On Sat, 19 Feb 2005 12:55:54 -0700, "Aaron" <ku*****@yahoo.com>
wrote:But how do I output the file as my_vacation_pic.jpg when the
actualfilename stored on the server is 0AX120S.jpg
Hi Aaron:
One way to do this is to use set the src attribute of an image tag
to an ASPX page, and have the ASPX page determine the correct
filename to use and write the jpeg contents back into the response.
Here is an example: http://msdn.microsoft.com/msdnmag/is...dge/default.as
px Hope this helps,
-- Scott http://www.OdeToCode.com/blogs/scott/
I hate it when clients do that!
Is it fun to change the requirement after the problem is solved? Why
not state the problem clearly next time so the answer fits the
problem by design instead of by accident?
Actually, with a little imagination this particular solution can be
adapted to any of the file types mentioned, or to solve it in
general, you could send an anonymous stream to the response object
based on the input file: read from source file, output to stream.
-- ipgrunt
This exchange has been fun to watch!
Hi Aaron,
Clicking a link sends a request to the web server. The response that comes
back has a small set of HTTP headers associated with it.
In these headers, you can specify the filename that you want the browser to
use when opening the file.
Content-Type = application/download
Content-Disposition = attachment; filename=my_vacation_pic.jpg
This will allow the user to save the file by the name you provide.
You simply have to code the headers.
I'm not clear from your messages if you are storing the files in the
database or just their names. If you are storing just their names, then you
will want your ASPX page to set the HTTP headers first, then read the file
into memory, encode to Base64, and stream it into the Response object.
The browser will do the rest.
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Aaron" <ku*****@yahoo.com> wrote in message
news:um**************@tk2msftngp13.phx.gbl... On my website I have a dynamic link(aspx) to this file 0AX120S.jpg(privacy protection). When a visitor clicks on the link I want them to see my_vacation_pic.jpg (fetch realname from database) is this possible with ASP.NET(C#)?
Thanks
Aaron
While I have never used it so I don't know if it is an answer to your
question for sure, when I read your question, I immediately thought of
articles I have read on the HttpContext.RewritePath method. http://www.aspnetpro.com/NewsletterA...200309pj_l.asp
DalePres
MCAD, MCDBA, MCSE
"Aaron" <ku*****@yahoo.com> wrote in message
news:um**************@tk2msftngp13.phx.gbl... On my website I have a dynamic link(aspx) to this file 0AX120S.jpg(privacy protection). When a visitor clicks on the link I want them to see my_vacation_pic.jpg (fetch realname from database) is this possible with ASP.NET(C#)?
Thanks
Aaron
All the uploaded files will be stored in a folder. Do you have an example on
how to set response headers in asp.net? I did a search the results only show
me how to get the request headers.
Also is this method compatible with older browsers? IE4 NS4?
Thanks,
Aaron
"Nick Malik [Microsoft]" <ni*******@hotmail.nospam.com> wrote in message
news:ir********************@comcast.com... This exchange has been fun to watch!
Hi Aaron,
Clicking a link sends a request to the web server. The response that comes back has a small set of HTTP headers associated with it. In these headers, you can specify the filename that you want the browser to use when opening the file.
Content-Type = application/download Content-Disposition = attachment; filename=my_vacation_pic.jpg
This will allow the user to save the file by the name you provide.
You simply have to code the headers.
I'm not clear from your messages if you are storing the files in the database or just their names. If you are storing just their names, then you will want your ASPX page to set the HTTP headers first, then read the file into memory, encode to Base64, and stream it into the Response object.
The browser will do the rest.
-- --- Nick Malik [Microsoft] MCSD, CFPS, Certified Scrummaster http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not representative of my employer. I do not answer questions on behalf of my employer. I'm just a programmer helping programmers. -- "Aaron" <ku*****@yahoo.com> wrote in message news:um**************@tk2msftngp13.phx.gbl... On my website I have a dynamic link(aspx) to this file 0AX120S.jpg(privacy protection). When a visitor clicks on the link I want them to see my_vacation_pic.jpg (fetch realname from database) is this possible with ASP.NET(C#)?
Thanks
Aaron
Thanks for the article. I'm experimenting with it right now. Don't know if
it work for my case. Since the files requested are not aspx files,
(zip,jpg,gif,pdf...)
Is global.asax responsible for all reqeusts made to the webapp or just the
asp.net ones?
"DalePres" <don-t-spa-m-me@lea-ve-me-a-lone--.com> wrote in message
news:ev**************@TK2MSFTNGP12.phx.gbl... While I have never used it so I don't know if it is an answer to your question for sure, when I read your question, I immediately thought of articles I have read on the HttpContext.RewritePath method.
http://www.aspnetpro.com/NewsletterA...200309pj_l.asp
DalePres MCAD, MCDBA, MCSE "Aaron" <ku*****@yahoo.com> wrote in message news:um**************@tk2msftngp13.phx.gbl... On my website I have a dynamic link(aspx) to this file 0AX120S.jpg(privacy protection). When a visitor clicks on the link I want them to see my_vacation_pic.jpg (fetch realname from database) is this possible with ASP.NET(C#)?
Thanks
Aaron
This works with IE4.01. This will not work with IE5.0, but it will work
with IE5.1 and higher. Stats prove that no one is using IE4 or NS4 anymore.
(If that's your market, then you are already out of business). I haven't
tested with Opera and Firefox, but that shouldn't be difficult to test with.
Word on the street is that those browsers are pretty darn good, so I
wouldn't expect any issues.
You need HTTPResponse.AppendHeader http://msdn.microsoft.com/library/en...eadertopic.asp
An article that can help http://aspalliance.com/articleViewer...aId=259&pId=-1
I picked these off of google
--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"Aaron" <ku*****@yahoo.com> wrote in message
news:uK**************@TK2MSFTNGP10.phx.gbl... All the uploaded files will be stored in a folder. Do you have an example on how to set response headers in asp.net? I did a search the results only show me how to get the request headers. Also is this method compatible with older browsers? IE4 NS4?
Thanks, Aaron
"Nick Malik [Microsoft]" <ni*******@hotmail.nospam.com> wrote in message news:ir********************@comcast.com... This exchange has been fun to watch!
Hi Aaron,
Clicking a link sends a request to the web server. The response that comes back has a small set of HTTP headers associated with it. In these headers, you can specify the filename that you want the browser to use when opening the file.
Content-Type = application/download Content-Disposition = attachment; filename=my_vacation_pic.jpg
This will allow the user to save the file by the name you provide.
You simply have to code the headers.
I'm not clear from your messages if you are storing the files in the database or just their names. If you are storing just their names, then you will want your ASPX page to set the HTTP headers first, then read the file into memory, encode to Base64, and stream it into the Response object.
The browser will do the rest.
-- --- Nick Malik [Microsoft] MCSD, CFPS, Certified Scrummaster http://blogs.msdn.com/nickmalik
Disclaimer: Opinions expressed in this forum are my own, and not representative of my employer. I do not answer questions on behalf of my employer. I'm just a programmer helping programmers. -- "Aaron" <ku*****@yahoo.com> wrote in message news:um**************@tk2msftngp13.phx.gbl... On my website I have a dynamic link(aspx) to this file 0AX120S.jpg(privacy protection). When a visitor clicks on the link I want them to see my_vacation_pic.jpg (fetch realname from database) is this possible with ASP.NET(C#)?
Thanks
Aaron
Aaron,
The way that I think that I would probably do your problem.
I would create in my database from every picture a thumbnail that I would
present on a imagebutton on my page
I would set reference number in a tag and that with the used paths in a
dataset that I would store in a session.
When the button is clicked I would get the image and translate that to a
bitmap.
That bitmap I would send using the response.redirect(bitmap)
Than the user would never know the original path.
Just an idea
Cor
You can, but it requires you to add new Application Mappings in IIS, then
you must program a DLL to do the actual job for you, in your case the DLL
would probably look up the file name from the database, and then HTTP
redirect the user to a download page where the user will start to download
the file.
-Inge
"Aaron" <ku*****@yahoo.com> wrote in message
news:um**************@tk2msftngp13.phx.gbl... On my website I have a dynamic link(aspx) to this file 0AX120S.jpg(privacy protection). When a visitor clicks on the link I want them to see my_vacation_pic.jpg (fetch realname from database) is this possible with ASP.NET(C#)?
Thanks
Aaron This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: jez123456 |
last post by:
Hi, I’ve written a c# program to compact certain msaccess databases. The way
this works is to compact say C:\test1.mdb to C:\temp.mdb, then delete
C:\test1.mdb and rename C:\temp.mdb as...
|
by: Aaron |
last post by:
On my website I have a dynamic link(aspx) to this file 0AX120S.jpg(privacy
protection). When a visitor clicks on the link I want them to see
my_vacation_pic.jpg (fetch realname from database) is...
|
by: Jay at SCA |
last post by:
I've been having the following issue with a windows
service I've created in vb.net (.net fw 1.1):
Basically, my service monitors a folder for the creation
of any new files of a particular type...
|
by: Bruce Russell |
last post by:
This may sound stupid but I can't rename the WebForm1.aspx in the
solution explorer.
The file is located in my local web server at
C:\Inetpub\wwwroot\Lab3-VB-Starter\WebForm1.aspx
Is there...
|
by: Tony Meyer |
last post by:
On Windows, if I do os.rename(old, new) where old is a file that is
in-use (e.g. python itself, or a dll that is loaded), I would expect
that an error would be raised (e.g. as when os.remove is...
|
by: Dynamo |
last post by:
I am trying to upload a file and then rename the file as something else.
Everything worked fine unless the renamed filename already existed. So I added
some extra code to check if the filename...
|
by: googlegroups |
last post by:
I have a standard template file that is available for download
(currently just an anchor tag). I would like to rename the file that
is sent to the client (to include an ID used by the template) so...
|
by: shapper |
last post by:
Hello,
I want to make a file available to a user for download on an ASP.NET
page.
So I need to have a button that when clicked, the file is download.
However, before the file is downloaded, I...
|
by: lllomh |
last post by:
Define the method first
this.state = {
buttonBackgroundColor: 'green',
isBlinking: false, // A new status is added to identify whether the button is blinking or not
}
autoStart=()=>{
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: tracyyun |
last post by:
Hello everyone,
I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
|
by: NeoPa |
last post by:
Hello everyone.
I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report).
I know it can be done by selecting :...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
|
by: Teri B |
last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course.
0ne-to-many. One course many roles.
Then I created a report based on the Course form and...
|
by: nia12 |
last post by:
Hi there,
I am very new to Access so apologies if any of this is obvious/not clear.
I am creating a data collection tool for health care employees to complete. It consists of a number of...
|
by: GKJR |
last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...
|
by: SueHopson |
last post by:
Hi All,
I'm trying to create a single code (run off a button that calls the Private Sub) for our parts list report that will allow the user to filter by either/both PartVendor and PartType. On...
| |