+1-888-365-2779
Try Now
More in this section

Forums / Sitefinity SDK / Specifying the site URL to upload to in Sitefinity 4.0 SDK?

Specifying the site URL to upload to in Sitefinity 4.0 SDK?

5 posts, 0 answered
  1. G S S
    G S S avatar
    71 posts
    Registered:
    16 Mar 2008
    14 Mar 2011
    Link to this post
    Hi,

    I've built a basic console app to upload documents to a document library on my Sitefinity 4 site. However, I have not specified the location of the site itself.

    Thus, how can I upload a document to a library when the code does not describe where the site is? How can I thus specify the site url?

    Bare in mind, I am on a shared hosting provider (DiscountASP.NET)...

    Thanks
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    15 Mar 2011
    Link to this post
    Hi G S S,

    You can use DocumentLibraryService

    sitefinity/services/content/documentlibraryservice.svc/help

    There is a SaveContent method that you can use.

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. G S S
    G S S avatar
    71 posts
    Registered:
    16 Mar 2008
    16 Mar 2011
    Link to this post
    Hi,

    Thanks for the link.

    However, could you give an example of how to invoke this from C#, attaching a document for upload?

    Thanks
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    16 Mar 2011
    Link to this post
    Hi G S S,

    1. You can access the service with javascript by using Sys.Net.WebRequest()
    2. Using server side code  and making HttpWebRequest

    You need to create the content object first and then save it through the service.

    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  5. G S S
    G S S avatar
    71 posts
    Registered:
    16 Mar 2008
    17 Mar 2011
    Link to this post
    Hi,

    How can I add the file to the web service request? I used the Content object previously,but I'd now need to serialize this in my request?

    Looking at the request example, it's not obvious how the file to upload is included.


    Could you give a full C# example of how I'd upload a file to the server using that service?

    EDIT: It looks like this link ( http://www.sitefinity.com/help/developer-manual/content-items-create.html) is what I need for creating and saving a content item.

    Thanks
5 posts, 0 answered