Specifying the site URL to upload to in Sitefinity 4.0 SDK? - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

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

  • Specifying the site URL to upload to in Sitefinity 4.0 SDK?
  • 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
  • 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!
  • Hi,

    Thanks for the link.

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

    Thanks
  • 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!
  • 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 ( www.sitefinity.com/.../content-items-create.html) is what I need for creating and saving a content item.

    Thanks