By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,943 Members | 1,875 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,943 IT Pros & Developers. It's quick & easy.

manually Send file to client

P: n/a
Is there a way to code it so that you can transmit a file to a client
programatically so that you could send it a file that is not part of
your website?

Like if my site is in c:\inetpub\mySite

Is there a way I can use like FileStream and read in a file from c:\
and then somehow transmit it to the client. (Purpose being to force the
user to go thru the website to access files and stop someone from
directly putting the url of the file they want to download in the
address bar)

I'm not sure how to transmit the data to the client though. Any ideas?
Thanks very much.

Nov 19 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
You can use Response.WriteFile to write any file on the server out to the
client. So if the file is outside the virtual directory, WriteFile will
write it out just fine, but the user would have no way of specifying a URL
for it, since it will be outside the virtual directory.

<wa********@yahoo.com> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...
Is there a way to code it so that you can transmit a file to a client
programatically so that you could send it a file that is not part of
your website?

Like if my site is in c:\inetpub\mySite

Is there a way I can use like FileStream and read in a file from c:\
and then somehow transmit it to the client. (Purpose being to force the
user to go thru the website to access files and stop someone from
directly putting the url of the file they want to download in the
address bar)

I'm not sure how to transmit the data to the client though. Any ideas?
Thanks very much.

Nov 19 '05 #2

P: n/a
Yeah, that works very well for downloading.

How about this though:?

You know how if you link to a .NET app in a web page and the client
clicks on the link using IE the program is downloaded and executed on
the client's machine?

Anyway of reproducing that same "link clicked" type behavior for a .NET
app (using Response.Writefile or something else) I have outside my
website so it will run automatically instead of the user having to hit
run on the save/as dialog?

Because w/ regular links the program simply runs when its link is
clicked. I'm not sure what the header's are that get sent when a link
is clicked like that.

Nov 19 '05 #3

P: n/a
You might want to use a Smart Client application if you want an app to run
when they click on the link.
The user is always going to be presented with a dialog box before any file
is downloaded to their computer though. This security precaution is well
warranted.
Would you want web sites automatically downloading strange files to your
computer without your permission? I think not.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net

<wa********@yahoo.com> wrote in message
news:11*********************@f14g2000cwb.googlegro ups.com...
Yeah, that works very well for downloading.

How about this though:?

You know how if you link to a .NET app in a web page and the client
clicks on the link using IE the program is downloaded and executed on
the client's machine?

Anyway of reproducing that same "link clicked" type behavior for a .NET
app (using Response.Writefile or something else) I have outside my
website so it will run automatically instead of the user having to hit
run on the save/as dialog?

Because w/ regular links the program simply runs when its link is
clicked. I'm not sure what the header's are that get sent when a link
is clicked like that.

Nov 19 '05 #4

P: n/a
I'm not sure what you mean by smart client.

And there is no confirmation when you click on a link to a .net
executable. It is downloaded cached and run w/o any user interaction at
all.

The only thing you may have to do is set the source as being trusted
depending on what the app needs to do.

Nov 19 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.