Upload files in different servers

Thread is closed for posting
6 posts, 0 answers
  1. Carlos Eduardo Nogueira
    Carlos Eduardo Nogueira avatar
    15 posts
    Member since:
    Jul 2009

    Posted 13 Aug 2009 Link to this post

    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?
  2. Carlos Eduardo Nogueira
    Carlos Eduardo Nogueira avatar
    15 posts
    Member since:
    Jul 2009

    Posted 11 Sep 2009 Link to this post

    Nobody?
  3. Paul
    Admin
    Paul avatar
    4281 posts

    Posted 11 Sep 2009 Link to this post

    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.
  4. Carlos Eduardo Nogueira
    Carlos Eduardo Nogueira avatar
    15 posts
    Member since:
    Jul 2009

    Posted 14 Sep 2009 Link to this post

    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
  5. Paul
    Admin
    Paul avatar
    4281 posts

    Posted 18 Sep 2009 Link to this post

    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.
  6. Carlos Eduardo Nogueira
    Carlos Eduardo Nogueira avatar
    15 posts
    Member since:
    Jul 2009

    Posted 18 Sep 2009 Link to this post

    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
Back to Top