Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nick 1 post 21 karma points
    Aug 29, 2012 @ 17:30
    Nick
    0

    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();

    And here is the error:
    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
       --- End of inner exception stack trace ---

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies