Reputation: 1052
i have two domains like domain1 and domain2.
I'm uploading file to domain1's server with server.SaveAs
method which uploads file to domain1
i want to upload same file to domain2 as well as domain1. can you people suggest me how can i do that.
how can i pass docx file into querystring ?
please do not ask me to use ftp.
Upvotes: 3
Views: 1641
Reputation: 1052
Issue resolved when we created an asp.net web api and deployed it to 2nd domain.
Upvotes: 1
Reputation: 148178
You can upload file to other domain from the server side using the WebClient.UploadFile When the file is uploaded to the domain of current page and is saved. You can upload it to other domain using the URL.
string fileName = "PhysicalPath";
WebClient myWebClient = new WebClient();
byte[] responseArray = myWebClient.UploadFile(uriString,fileName);
Upvotes: 2