This is a migrated thread and some comments may be shown as answers.

Upload files in different servers

5 Answers 208 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Carlos Eduardo Nogueira
Top achievements
Rank 1
Carlos Eduardo Nogueira asked on 13 Aug 2009, 02:44 PM
Hi,

I'm using RadUpload object to upload files in website but I found a problem about this subject. I have the website in a development server using IIS 6.0 (with windows 2003 server) and I would like upload the files by website in a file server (with windows 2003 server).
So, after to publish the website in a development server, I created virtual directory (in that structure) to indicate the paste I created in a file server. I mapped the network drive to use in this virtual directory. In a development server, the path to access the paste in a file server is: "Z:\Upload".

When I'm using the page I have RadUpload object, the page has the code as you can see below to upload files:

string targetFolder = Server.MapPath("~/Arq");
validFile.SaveAs(Path.Combine(targetFolder, nameFile), true);

PS: (Arq is alias used in virtual directory)

When the website try to save the file, I have an exception with the message as you can see below:

"Cant' find the part of the path Z:\Upload\testfile.pdf" or "Can't find the path Z:\Upload\testfile.pdf".

I tried give permissions to iis user for the paste, but I couldn't do it.

Anyone know how I can overcome this problem?

5 Answers, 1 is accepted

Sort by
0
Carlos Eduardo Nogueira
Top achievements
Rank 1
answered on 11 Sep 2009, 01:53 PM
Nobody?
0
Paul
Telerik team
answered on 11 Sep 2009, 02:32 PM
Hello Carlos Eduardo Nogueira,

In order to achieve your goal you should set the TargetPhysicalFolder property to point to the UNC path.

Sincerely yours,
Paul
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Carlos Eduardo Nogueira
Top achievements
Rank 1
answered on 14 Sep 2009, 07:10 PM
Hi Paul,

I changed the property with the value you said in the last post, but I obtained the same problem. I just changed TargetPhysicalFolder property for UNC path as you can see below:

RadUpload1.TargetPhysicalFolder = @"\\192.168.0.4\c$\Files\Upload"
foreach (UploadedFile validFile in RadUpload1.UploadedFiles) 
    string targetFolder = Server.MapPath("~/Arq"); 
    validFile.SaveAs(Path.Combine(targetFolder, "UploadTest.pdf"), true); 




It's an example. The path of virtual directory (Arq) is Z:\Upload.

Is there anything I need to set to achieve my goal besides this example?

Regards
Carlos
0
Paul
Telerik team
answered on 18 Sep 2009, 12:15 PM
Hello Carlos,

I guess you will have to specify the login credentials (i.e., specific account) for the UNC Path in RadUpload. However, I'm afraid this is out of the scope of RadUpload control. I suggest you make a search on Google for tips on the matter. Here are some links we got on a fast search:

http://social.msdn.microsoft.com/forums/en-US/netfxnetcom/thread/60c2f65d-76a2-4b2f-8521-1f630c899979
http://forums.iis.net/t/1146075.aspx
http://forums.asp.net/t/1264927.aspx

First you have to add some logic about the Logging Credentials. RadUpload can only upload files. It cannot be used as logging credential manager.

The ASPNET user account that ASP.NET uses by default does not have network permissions. Either give the account such network permissions (likely with the help of your network administrator) or use impersonation to have it run under a different user account that does have such permissions. For testing purposes you can have it run under your personal user account. Here's more info: http://msdn.microsoft.com/en-us/library/xh507fc5(vs.71).aspx.

More info on the matter:
Understanding ASP.NET Impersonation Security
Upload files to UNC share using ASP.NET

Regards,
Paul
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Carlos Eduardo Nogueira
Top achievements
Rank 1
answered on 18 Sep 2009, 07:37 PM
Hi Paul,

I will check this information and after it, I will to write here. For this situation, do you have other manner to upload files in different servers using RadUpload?

Regards
Carlos
Tags
Upload (Obsolete)
Asked by
Carlos Eduardo Nogueira
Top achievements
Rank 1
Answers by
Carlos Eduardo Nogueira
Top achievements
Rank 1
Paul
Telerik team
Share this question
or