473,385 Members | 1,356 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,385 software developers and data experts.

Copy Files

I am searching here...

I am trying to create a Web App that allows me to copy a file from a
server to a users local computer. I want the user to press a button and
that should cause the file to be moved. I have created this locally on
my computer and it works, of course it works. Everything works locally
on my computer, sorry tangent...

When I publish it the web and try to use it, it will not map the local
file. Not sure if this is a permission issue. Really just wondering if
this is possible.

Any help would be appreciated!

Scott Moore

Dec 28 '06 #1
19 5827
samoore wrote:
I am searching here...

I am trying to create a Web App that allows me to copy a file from a
server to a users local computer. I want the user to press a button and
that should cause the file to be moved. I have created this locally on
my computer and it works, of course it works. Everything works locally
on my computer, sorry tangent...

When I publish it the web and try to use it, it will not map the local
file. Not sure if this is a permission issue. Really just wondering if
this is possible.

Any help would be appreciated!

Scott Moore
Can you post your code to us?

Dec 28 '06 #2
string source = @"\\server\FileCopy\file.exe";
string dest = @"C:\Program Files\Folder\Tool\File.exe";
try
{
string newDir = @"C:\\";
Directory.SetCurrentDirectory(newDir);
dest = Directory.GetCurrentDirectory() + "Program
Files\\Folder\\Tool\\File.exe";
lblTest.Text =
System.Security.Principal.WindowsIdentity.GetCurre nt().Name.ToString();

File.Delete(dest);

File.Copy(source, dest);

lblResult.Visible = true;
}
catch (Exception f)
{
lblResult.Text = f.ToString();
lblResult.Visible = true;
}

john sun wrote:
samoore wrote:
I am searching here...

I am trying to create a Web App that allows me to copy a file from a
server to a users local computer. I want the user to press a button and
that should cause the file to be moved. I have created this locally on
my computer and it works, of course it works. Everything works locally
on my computer, sorry tangent...

When I publish it the web and try to use it, it will not map the local
file. Not sure if this is a permission issue. Really just wondering if
this is possible.

Any help would be appreciated!

Scott Moore
Can you post your code to us?
Dec 28 '06 #3
Hi,

You cannot do that, a web app could be outside your local network so it will
not have access as a file copy operation.
What you can do is download a remote file; just use the Page.Response you
open your file, set the correct content-type and just pipe the content of
the file to Response.OutputStream
--
Ignacio Machin
machin AT laceupsolutions com

"samoore" <sa*******@gmail.comwrote in message
news:11**********************@42g2000cwt.googlegro ups.com...
>I am searching here...

I am trying to create a Web App that allows me to copy a file from a
server to a users local computer. I want the user to press a button and
that should cause the file to be moved. I have created this locally on
my computer and it works, of course it works. Everything works locally
on my computer, sorry tangent...

When I publish it the web and try to use it, it will not map the local
file. Not sure if this is a permission issue. Really just wondering if
this is possible.

Any help would be appreciated!

Scott Moore

Dec 28 '06 #4
The file will be located in the same folder as the aspx page. I want to
use the aspx page to copy that file to a location on the users
computer. These users have to log into the website to be able to get to
the page that will allow them to copy the file.

The way you explained it, I did not think we are on the same page with
what I am trying to accomplish.

Scott Moore

Ignacio Machin ( .NET/ C# MVP ) wrote:
Hi,

You cannot do that, a web app could be outside your local network so it will
not have access as a file copy operation.
What you can do is download a remote file; just use the Page.Response you
open your file, set the correct content-type and just pipe the content of
the file to Response.OutputStream
--
Ignacio Machin
machin AT laceupsolutions com

"samoore" <sa*******@gmail.comwrote in message
news:11**********************@42g2000cwt.googlegro ups.com...
I am searching here...

I am trying to create a Web App that allows me to copy a file from a
server to a users local computer. I want the user to press a button and
that should cause the file to be moved. I have created this locally on
my computer and it works, of course it works. Everything works locally
on my computer, sorry tangent...

When I publish it the web and try to use it, it will not map the local
file. Not sure if this is a permission issue. Really just wondering if
this is possible.

Any help would be appreciated!

Scott Moore
Dec 28 '06 #5


samoore wrote:
The file will be located in the same folder as the aspx page. I want to
use the aspx page to copy that file to a location on the users
computer. These users have to log into the website to be able to get to
the page that will allow them to copy the file.

The way you explained it, I did not think we are on the same page with
what I am trying to accomplish.

Scott Moore
I am not an expert as Ignacio, but my question for you, why don't you
simply let them download the file.

You can simply have them press the button to start downloading the file..

J.W.
>
Ignacio Machin ( .NET/ C# MVP ) wrote:
>Hi,

You cannot do that, a web app could be outside your local network so it will
not have access as a file copy operation.
What you can do is download a remote file; just use the Page.Response you
open your file, set the correct content-type and just pipe the content of
the file to Response.OutputStream
--
Ignacio Machin
machin AT laceupsolutions com

"samoore" <sa*******@gmail.comwrote in message
news:11**********************@42g2000cwt.googlegr oups.com...
>>I am searching here...

I am trying to create a Web App that allows me to copy a file from a
server to a users local computer. I want the user to press a button and
that should cause the file to be moved. I have created this locally on
my computer and it works, of course it works. Everything works locally
on my computer, sorry tangent...

When I publish it the web and try to use it, it will not map the local
file. Not sure if this is a permission issue. Really just wondering if
this is possible.

Any help would be appreciated!

Scott Moore
Dec 28 '06 #6
Hi,

"samoore" <sa*******@gmail.comwrote in message
news:11**********************@a3g2000cwd.googlegro ups.com...
The file will be located in the same folder as the aspx page. I want to
use the aspx page to copy that file to a location on the users
computer. These users have to log into the website to be able to get to
the page that will allow them to copy the file.

The way you explained it, I did not think we are on the same page with
what I am trying to accomplish.
No, we are not. This is cause what you want cannot be done. :)

you have to do as I said before, download the file as you download other
files from the internet.
--
Ignacio Machin
machin AT laceupsolutions com
Dec 28 '06 #7
On 28 Dec 2006 06:08:57 -0800, samoore wrote:
I am searching here...

I am trying to create a Web App that allows me to copy a file from a
server to a users local computer. I want the user to press a button and
that should cause the file to be moved. I have created this locally on
my computer and it works, of course it works. Everything works locally
on my computer, sorry tangent...

When I publish it the web and try to use it, it will not map the local
file. Not sure if this is a permission issue. Really just wondering if
this is possible.

Any help would be appreciated!

Scott Moore
Copying files from your server to the users computer would imply that your
server somehow has access to the user's computer and file system. That
right there sets of warning bells.

Why don't you let the users download and put the files where they want?
--
Bits.Bytes
http://bytes.thinkersroom.com
Dec 28 '06 #8
Downloading the file would be fine, I was not sure I could do that with
a Web App. I have tried using OpenDialog with the web app and it will
not allow me. If this can be done with a Web App, can I get a point in
the right direction please.

Scott Moore

Rad [Visual C# MVP] wrote:
On 28 Dec 2006 06:08:57 -0800, samoore wrote:
I am searching here...

I am trying to create a Web App that allows me to copy a file from a
server to a users local computer. I want the user to press a button and
that should cause the file to be moved. I have created this locally on
my computer and it works, of course it works. Everything works locally
on my computer, sorry tangent...

When I publish it the web and try to use it, it will not map the local
file. Not sure if this is a permission issue. Really just wondering if
this is possible.

Any help would be appreciated!

Scott Moore

Copying files from your server to the users computer would imply that your
server somehow has access to the user's computer and file system. That
right there sets of warning bells.

Why don't you let the users download and put the files where they want?
--
Bits.Bytes
http://bytes.thinkersroom.com
Dec 28 '06 #9
samoore wrote:
Downloading the file would be fine, I was not sure I could do that with
a Web App. I have tried using OpenDialog with the web app and it will
not allow me. If this can be done with a Web App, can I get a point in
the right direction please.

Scott Moore
Just use a http link to point to the file. I think that should be enough.
Rad [Visual C# MVP] wrote:
>On 28 Dec 2006 06:08:57 -0800, samoore wrote:
>>I am searching here...

I am trying to create a Web App that allows me to copy a file from a
server to a users local computer. I want the user to press a button and
that should cause the file to be moved. I have created this locally on
my computer and it works, of course it works. Everything works locally
on my computer, sorry tangent...

When I publish it the web and try to use it, it will not map the local
file. Not sure if this is a permission issue. Really just wondering if
this is possible.

Any help would be appreciated!

Scott Moore
Copying files from your server to the users computer would imply that your
server somehow has access to the user's computer and file system. That
right there sets of warning bells.

Why don't you let the users download and put the files where they want?
--
Bits.Bytes
http://bytes.thinkersroom.com
Dec 28 '06 #10
I have created a hyperlink pointing to the file. When I click on it
nothing happens. Am I allowed to do this for an exe file? I know it
would probably be better to do this for zip file, but that may not be
an option.

Isn't coding fun!

Scott Moore

john sun wrote:
samoore wrote:
Downloading the file would be fine, I was not sure I could do that with
a Web App. I have tried using OpenDialog with the web app and it will
not allow me. If this can be done with a Web App, can I get a point in
the right direction please.

Scott Moore

Just use a http link to point to the file. I think that should be enough.
Rad [Visual C# MVP] wrote:
On 28 Dec 2006 06:08:57 -0800, samoore wrote:

I am searching here...

I am trying to create a Web App that allows me to copy a file from a
server to a users local computer. I want the user to press a button and
that should cause the file to be moved. I have created this locally on
my computer and it works, of course it works. Everything works locally
on my computer, sorry tangent...

When I publish it the web and try to use it, it will not map the local
file. Not sure if this is a permission issue. Really just wondering if
this is possible.

Any help would be appreciated!

Scott Moore
Copying files from your server to the users computer would imply that your
server somehow has access to the user's computer and file system. That
right there sets of warning bells.

Why don't you let the users download and put the files where they want?
--
Bits.Bytes
http://bytes.thinkersroom.com
Dec 29 '06 #11
On 29 Dec 2006 06:03:44 -0800, samoore wrote:
I have created a hyperlink pointing to the file. When I click on it
nothing happens. Am I allowed to do this for an exe file? I know it
would probably be better to do this for zip file, but that may not be
an option.

Isn't coding fun!
Perhaps we could help you better if we knew exactly what sort of files you
want the user to download. Are they executables? Data files? A mix? How
often are the files downloaded? Weekly? Daily?

--
Bits.Bytes
http://bytes.thinkersroom.com
Dec 29 '06 #12
This is a executable file that at this point would be a one time
download. There is a possibility that this option of downloading files
could be used later on for a mix of files. My main goal right now is to
get this file to download and have it download once.

We have Install Shield Express 5.0 that we use to create CD's. When I
try to use it to create an update patch I always get an error. This is
my second option of trying to find a way to let users update a program.
I need an easy way to do this without to much assistance needed from
the user. Most of the users are not computer savvy.

Scott

Rad [Visual C# MVP] wrote:
On 29 Dec 2006 06:03:44 -0800, samoore wrote:
I have created a hyperlink pointing to the file. When I click on it
nothing happens. Am I allowed to do this for an exe file? I know it
would probably be better to do this for zip file, but that may not be
an option.

Isn't coding fun!

Perhaps we could help you better if we knew exactly what sort of files you
want the user to download. Are they executables? Data files? A mix? How
often are the files downloaded? Weekly? Daily?

--
Bits.Bytes
http://bytes.thinkersroom.com
Dec 29 '06 #13
On 29 Dec 2006 11:00:52 -0800, samoore wrote:
This is a executable file that at this point would be a one time
download. There is a possibility that this option of downloading files
could be used later on for a mix of files. My main goal right now is to
get this file to download and have it download once.

We have Install Shield Express 5.0 that we use to create CD's. When I
try to use it to create an update patch I always get an error. This is
my second option of trying to find a way to let users update a program.

I need an easy way to do this without to much assistance needed from
the user. Most of the users are not computer savvy.

Scott
Is this file being downloaded the executable that the users will run? If so
I suggest you take a look at ClickOnce deployment.

--
Bits.Bytes
http://bytes.thinkersroom.com
Dec 29 '06 #14
No. It is an update to a program that they will have on their computer.
I want to replace the executable that they already have on their
computer.

Rad [Visual C# MVP] wrote:
On 29 Dec 2006 11:00:52 -0800, samoore wrote:
This is a executable file that at this point would be a one time
download. There is a possibility that this option of downloading files
could be used later on for a mix of files. My main goal right now is to
get this file to download and have it download once.

We have Install Shield Express 5.0 that we use to create CD's. When I
try to use it to create an update patch I always get an error. This is
my second option of trying to find a way to let users update a program.

I need an easy way to do this without to much assistance needed from
the user. Most of the users are not computer savvy.

Scott

Is this file being downloaded the executable that the users will run? If so
I suggest you take a look at ClickOnce deployment.

--
Bits.Bytes
http://bytes.thinkersroom.com
Jan 1 '07 #15
On 1 Jan 2007 07:23:32 -0800, samoore wrote:
No. It is an update to a program that they will have on their computer.
I want to replace the executable that they already have on their
computer.
In that case my good man I suggest you investigate ClickOnce deployment. I
believe that will do what you are looking for.

--
Bits.Bytes
http://bytes.thinkersroom.com
Jan 2 '07 #16
Unfortunatly, it looks like the ClickOnce technology is written in 2.0.
We are using 1.1 and I am not sure how soon we are going to move to
2.0, especially since I heard they are coming out with 3.0 and
installing 3.0 will remove 1.1.

If there is any possibility of a different way of doing this, please
let me know after you stop laughing.

Scott

Rad [Visual C# MVP] wrote:
On 1 Jan 2007 07:23:32 -0800, samoore wrote:
No. It is an update to a program that they will have on their computer.
I want to replace the executable that they already have on their
computer.

In that case my good man I suggest you investigate ClickOnce deployment. I
believe that will do what you are looking for.

--
Bits.Bytes
http://bytes.thinkersroom.com
Jan 5 '07 #17
For what it's worth .NET 3.0 doesn't remove .NET 1.1; it shares much of .NET
2.0 but doesn't remove any of the previous runtimes!

- Andy

"samoore" <sa*******@gmail.comwrote in message
news:11**********************@i15g2000cwa.googlegr oups.com...
Unfortunatly, it looks like the ClickOnce technology is written in 2.0.
We are using 1.1 and I am not sure how soon we are going to move to
2.0, especially since I heard they are coming out with 3.0 and
installing 3.0 will remove 1.1.

If there is any possibility of a different way of doing this, please
let me know after you stop laughing.

Scott

Rad [Visual C# MVP] wrote:
>On 1 Jan 2007 07:23:32 -0800, samoore wrote:
No. It is an update to a program that they will have on their computer.
I want to replace the executable that they already have on their
computer.

In that case my good man I suggest you investigate ClickOnce deployment.
I
believe that will do what you are looking for.

--
Bits.Bytes
http://bytes.thinkersroom.com

Jan 5 '07 #18
On 5 Jan 2007 13:02:20 -0800, samoore wrote:
Unfortunatly, it looks like the ClickOnce technology is written in 2.0.
We are using 1.1 and I am not sure how soon we are going to move to
2.0, especially since I heard they are coming out with 3.0 and
installing 3.0 will remove 1.1.

If there is any possibility of a different way of doing this, please
let me know after you stop laughing.

Scott
Not to worry Scott, no one is laughing.

Well, if I remember correctly .net 1.1 has an earlier equivalent to click
once, i think it's called No touch deployment. It works pretty much in the
same way but you need to do a bit more work yourself, in particular
automating the updates.

Lemme try and find out where I stored links to those resources on my PC and
i'll let you know where you can find more info

--
Bits.Bytes
http://bytes.thinkersroom.com
Jan 6 '07 #19
On Fri, 5 Jan 2007 21:16:49 -0000, Andy Bates wrote:
For what it's worth .NET 3.0 doesn't remove .NET 1.1; it shares much of .NET
2.0 but doesn't remove any of the previous runtimes!

- Andy
Just to add on to that, it just goes to show the poor choice Microsoft make
in naming it .NET 3.0 because it is actually .NET 2.0 with a bunch of new
namespaces and classes thrown in, which in effect means .NET 2 is a subset
of .NET 3

--
Bits.Bytes
http://bytes.thinkersroom.com
Jan 6 '07 #20

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

Similar topics

11
by: Mike | last post by:
I want to be able to copy a directory of files (all .HTM files) from a network drive to a local drive on the machine c:\HTMFiles , How can i do that? I tried File.Copy(source, dest) but i need...
6
by: Wayne Wengert | last post by:
I am using VSNET 2003 to build an ASP.NET/VB set of pages. There are currently about a dozen aspx pages. When I make even a minor change to one page I currently rebuild the solution, copy the...
3
by: Johnny | last post by:
Hi, I have created an ASP.NET application (let's call it FooBar) with VS.NET on my local machine, residing in http://localhost/FooBar. Deploying it to another folder on my machine works well...
2
by: Steve Franks | last post by:
The Copy Web tool provided with VS.NET 2005 is very convenient. However every once in a while it seems to think the files on the remote server have changed, which they have not. Then when I use...
5
by: DraguVaso | last post by:
Hi, I'm looking for a way to Copy and Paste Files to the clipboard. I found a lot of articles to copy pieces of text and bitmaps etc, but nog whole files. Whay I need is like you have in...
8
by: luis molina Micasoft | last post by:
it seems that when i do file.copy the svchost.exe is hanged, i mean if i make 40 threads of file.copy , 40 copys of files at same time the system is going down and stop responding, this is when i'm...
1
by: dkmarni | last post by:
Hi, I am trying to do this perl script, but not able to complete it successfully. Here is the description what the script has to do.. Accept two and only two command line arguments. Again,...
13
by: jim | last post by:
Is there a way (using VB.Net or C#) to copy open or locked files? Thanks! jim
1
by: =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post by:
Using .NET 2.0 is it more efficient to copy files to a single folder versus spreading them across multiple folders. For instance if we have 100,000 files to be copied, Do we copy all of them to...
1
by: =?Utf-8?B?UmFkZW5rb19aZWM=?= | last post by:
I am using standard File.Copy(source,dest,true) method in C# and I have problem with copying large number of files. Here is my code: foreach (FileInfo file in files) {...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: 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...

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.