I'm trying to use Umbraco's file web service, but cannot figure out how to upload a file. I think my real problem is, I don't really know what the folder parameter refers to. Is it a folder on the file system, a media folder?
Below is some basic code I have tried. I've tried changing the folderName variable to different folders within Umbraco, as well as the file system to no avail.
I haven't found much documentation on this, so if someone can tell me what this is *supposed* to do, that would be great.
string filename = @"C:\myimg.jpg";
string folderName = "Home";
UmbFileSvc.fileServiceSoapClient client = new UmbFileSvc.fileServiceSoapClient();
An unhandled exception of type 'System.ServiceModel.FaultException' occurred in mscorlib.dll
Additional information: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.ArgumentException: no access to specified folder
at umbraco.webservices.files.fileService.UploadFile(Byte[] docbinaryarray, String folderName, String fileName, String username, String password, Boolean deleteOld) in ...\umbraco_92d7d98ea3fe\components\umbraco.webservices\FileService.asmx.cs:line 126
Using the File Web Service
I'm trying to use Umbraco's file web service, but cannot figure out how to upload a file. I think my real problem is, I don't really know what the folder parameter refers to. Is it a folder on the file system, a media folder?
Below is some basic code I have tried. I've tried changing the folderName variable to different folders within Umbraco, as well as the file system to no avail.
I haven't found much documentation on this, so if someone can tell me what this is *supposed* to do, that would be great.
string filename = @"C:\myimg.jpg";
string folderName = "Home";
UmbFileSvc.fileServiceSoapClient client = new UmbFileSvc.fileServiceSoapClient();
client.Open();
client.UploadFile(System.IO.File.ReadAllBytes(filename), folderName, filename, "username", "password", false);
client.Close();
is working on a reply...