• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 249
  • Last Modified:

Storing a file on a fifferent server

Hi,
 
    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.
0
dotnetuser07
Asked:
dotnetuser07
  • 3
  • 2
1 Solution
 
guru_samiCommented:
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: http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.fileupload.saveas.aspx
0
 
dotnetuser07Author Commented:
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?
0
 
guru_samiCommented:
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
0
 
dotnetuser07Author Commented:
Thank you so much. Is there any sample code to look into?  Becasue i am unable to access the path to another sever?..
0
 
guru_samiCommented:
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.
0

Featured Post

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now