473,403 Members | 2,366 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,403 software developers and data experts.

manually Send file to client

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
4 1911
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: zhimin | last post by:
Hi, I'm writing a program to send large file(100m) through dotnet using TCPListener & TCPClient, I'm sending the file with a ask and response loop: 1. Client send a flag 1 to server indicate it...
2
by: Robbie De Sutter | last post by:
Hello, How do I open a new, empty e-mail message from the default e-mail client whereby the sender is given and a file is attached? Currently I use the command (vb.net): ---...
1
by: Henk | last post by:
Hi, I made a client and server application. I'm trying to send an xml file from the server to the client. It works, but there are some problems: the file the client receives is the same as the file...
1
by: Chenzo | last post by:
I have an issue where the provided .wsdl file is being generated incorrectly with the WSDL.exe tool. I have to use digital client certificates for authentication and it has been determined...by...
6
by: teddysnips | last post by:
My client has a number of jobs that are run overnight. We've set them up to email me when they're completed. Every morning I get in to a bunch of emails like this: <quote> JOB RUN: 'Tech...
14
by: eliss.carmine | last post by:
I'm using TCP/IP to send a Bitmap object over Sockets. This is my first time using C# at all so I don't know if this is the "right" way to do it. I've already found out several times the way I was...
9
by: Mahernoz | last post by:
Can i send an email from JavaScript? Is it possible? If yes please the code to send email using javascript...
4
by: Hugh Oxford | last post by:
I am writing some server to server software that needs to maintain state. When I say server to server I mean that the client is not a browser, it is another PHP server (as if that wasn't...
2
by: SvenV | last post by:
I based my program on the asynchronous client/server example on msdn. There weren't too many modifications to the original code. I just created some extra code to response to different messages. F.e....
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.