473,657 Members | 2,476 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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\mySi te

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 1925
You can use Response.WriteF ile 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********@yah oo.com> wrote in message
news:11******** **************@ c13g2000cwb.goo glegroups.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\mySi te

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.Writef ile 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********@yah oo.com> wrote in message
news:11******** *************@f 14g2000cwb.goog legroups.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.Writef ile 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
913
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 has data send to server. 2. Client send the buffer block size. 3. Client send the actual buffer to the server. 4. Server send a flag 1 to client indicating that the buffer has been successfully receeived. 5. The next loop until all data of the...
2
12179
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): --- System.Diagnostics.Process.Start("mailto:someone@somewhere&subject=the% 20subject") ---
1
2068
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 the server sends but there are some spaces added at the end, and this causes that I can't open the file correctly. This is part of my server code: Dim fs As FileStream
1
11464
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 another business...that the proxy class was generated by the wsdl.exe tool incorrectly for use with the client certificates. The solution was stated to be to 'manually write a proxy class without using the wsdl.exe tool'. I'm not sure how to do...
6
16420
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 Pubs Email Notification' was run on 18/03/2006 at 00:00:00 DURATION: 0 hours, 0 minutes, 0 seconds STATUS: Succeeded
14
11889
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 doing something was really inefficient and could reduce 10 lines of code with 2, etc. For reading, I am using a TcpClient and I call NetworkStream ns = client.GetStream(); to get a stream stream.Read(buffer, 0, buffer.Length);
9
77425
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
5672
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 obvious). The obvious way to do this is to use the session ID. The problem is, how to first of all generate a session ID and then send back a session ID to reload a session. Perhaps my understanding of sessions is too limited, but I can't see the
2
1537
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. when I send GETARTICLES<EOF> it gets the articles from the DB and when I send something else it does that specific task. That all works fine. The problem is when I connect to the server and I try to send 2 commands after another. F.e. First get the...
0
8324
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8842
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8740
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8516
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8617
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7353
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6176
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2743
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.