Storing a file on a fifferent server

Posted on 2009-02-12
Last Modified: 2013-11-07
    I have a question regarding Storing a file on a different server.
I need to write code for uploading files like Tiff, jpg(images) etc. I am thinking to use File upload control for this. With file upload, the file will be uploaded to the server(Prod) which has the code. But i need to store those files on a different server.
I am new to this ASP.Net  What do I need to do for this kind of stuff.

Thanks in Advance.
Question by:dotnetuser07
    LVL 41

    Expert Comment

    Never did on seperate server but.. try this:
    With FileUpload SaveAs Method passing the full path where the file needs to be stored.
    And the account under which the file will be written to that server should have access and write permission to that server as well as to the directory in which the file is uploaded.

    Check this:

    Author Comment

    OK Thanks. This is a web application. So, many people will be using this page to upload the files.
    Every one wont have access to that server rite?. What in that case?
    LVL 41

    Expert Comment

    In most cases it should be Network/Service account if its Win2k3 server if you have not set
    <identity impersonation=true /> in the web.config of your webapp.

    Or you can set <identity impersonation=true  username="abc" password=xyz" /> where abc is an account which has access to your file server and has write permission to the directory.

    although this is one way to go ... if it works :D

    Author Comment

    Thank you so much. Is there any sample code to look into?  Becasue i am unable to access the path to another sever?..
    LVL 41

    Accepted Solution

    Sorry I don't have any sample code...
    I did not try using fileUpload SaveAs method to transfer files on different server. So not sure if it allows that. If that does not work ... other option would be..

    1: Use FileUpload Control to upload file on the WebServer where your web app is running
    2: Write some service that runs periodially or depending on your need to copy the files from WebServer Directory to your Another Server.

    If something else pops up ... i will let you know.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Suggested Solutions

    Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
    This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
    In this sixth video of the Xpdf series, we discuss and demonstrate the PDFtoPNG utility, which converts a multi-page PDF file to separate color, grayscale, or monochrome PNG files, creating one PNG file for each page in the PDF. It does this via a c…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now