Copy Files

  • Thread starter Thread starter samoore
  • Start date Start date
S

samoore

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
 
samoore said:
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?
 
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.GetCurrent().Name.ToString();

File.Delete(dest);

File.Copy(source, dest);

lblResult.Visible = true;
}
catch (Exception f)
{
lblResult.Text = f.ToString();
lblResult.Visible = true;
}
 
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
 
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
 
samoore said:
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.
 
Hi,

samoore said:
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.
 
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?
 
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
 
samoore said:
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.
 
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 said:
samoore said:
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.
 
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?
 
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
 
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.
 
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.
 
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.
 
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
 
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 said:
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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top