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
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
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