Click here to Skip to main content
15,892,965 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i'm trying to add an image into a drupal 7 node. i searched the web but didn't find much. i thought of uploading an image and add it in folder(sites/all/default) but in vain. I'm getting some error in the XmlRpcClientProtocol.cs - "Could not write file to destination".
Maybe this isn't the best approach of adding and image, if you have other ideas it would be of great help.

i used file.create ethod.

C#
XmlRpcStruct file = new XmlRpcStruct();

   file.Add("file", encodedData);
   file.Add("filename", filename);
   file.Add("filepath", "sites/default/files/" + filename);
   file.Add("filesize", filestream.Length);
   file.Add("timestamp", DateTime.Now.ToShortTimeString());

drupal.FileSave(file);


Any suggestions?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900