का उपयोग कर शेयरपॉइंट (WSS 3.0) दस्तावेज़ लाइब्रेरी में फ़ाइलों को अपलोड करना हाय मेरे पास शेयरपॉइंट पर फ़ाइल अपलोड करने के लिए कोड का निम्न भाग है। यह HTTP PUT उपयोग करता है:HTTP PUT
"The remote server returned an error: (409) Conflict."
किसी को भी, जहां मैं गलत जा रहा हूँ के रूप में किसी भी विचार है:
public static string UploadFile(string destUrl, string sourcePath)
{
try
{
Uri destUri = new Uri(destUrl);
FileStream inStream = File.OpenRead(sourcePath);
WebRequest req = WebRequest.Create(destUri);
req.Method = "PUT";
req.Headers.Add("Overwrite", "F");
req.Timeout = System.Threading.Timeout.Infinite;
req.Credentials = CredentialCache.DefaultCredentials;
Stream outStream = req.GetRequestStream();
string status = CopyStream(inStream, outStream);
if (status == "success")
{
outStream.Close();
WebResponse ores = req.GetResponse();
return "success";
}
else
{
return status;
}
}
catch (WebException we)
{
return we.Message;
}
catch (System.Exception ee)
{
return ee.Message;
}
}
मुझे इस कोड को चलाने मैं अपवाद मिल सकता है?
धन्यवाद,
एलेक्स
मुझे अभी भी एक ही समस्या का सामना करना पड़ा है - जांचें कि यूआरएल वैध हैं! – Rashack
सी # नोब पूछता है: CopyStream कहां से आता है? –
यह CopyRiver – Amicable