cancel
Showing results for 
Search instead for 
Did you mean: 

Upload image/text file to alfresco using C#.Net ...

kannank
Champ in-the-making
Champ in-the-making
Hi,

I want to upload image as well as text file from hard disc drive to alfresco repository using Dotnet.

Please give me some sample code to upload image or text from  hard disc drive to alfresco using C# or VB.Net.

Looking for your help urgently,

Thanks,

K.Kannan.
6 REPLIES 6

gentyjp
Champ in-the-making
Champ in-the-making
Hi

Just have a look in

alfresco-src-1.2.0 package in \projects\extensions\dotNET2

Cheers

Jean-Paul

kannank
Champ in-the-making
Champ in-the-making
Hi,

Thanks for your response.

Actually we have referred that in "alfresco-src-1.2.0 package in \projects\extensions\dotNET2" and that is working fine - In that I observed that the output displays the store details (The output shows all the folders - When double clicking it shows the sub-folder or the file) and that one works fine.

But I want to upload an image or test file from local machine say "from folder D" to "one of the alfresco subfolders" selected by user.

I want some clue or working sample urgently,so your early reply is very much appreciated.

Looking for your message,

Regards,

K.Kannan.

rwetherall
Confirmed Champ
Confirmed Champ
Hi,

As you will have noticed the current dotNet sample does not cover the full breadth of Alfresco functionality, more it set of examples to get people started.  We hope to expand this set of samples by adding this code as project to the Alfresco forge http://forge.alfresco.com this will allow the Alfresco dotNet community to expand the samples themselves and maybe build it into a tool kit that other dotNet developers can use with Alfresco.

In the mean time then method you are interesting in calling in order to upload content is write on the contentWebService.  You need to pass the reference of the object that you want to set the content on, the name of the content property to set, the content as a byte array and the content format object which contains the mimetype and encoding.

If you need more help then I would suggest looking at the Java web service client code (ContentUtils.java) as it may provide some more clues.

Cheers,
Roy

tcardoso
Champ in-the-making
Champ in-the-making
Hi,

I was just checking out the sample you mentioned, and it seems that at some point they use a certain class by the name "RequestSoapContext", which is supposed to be implemented at "Alfresco.RepositoryWebService".

Well, it actually isn't, and I was wondering if this is supposed to be like this, or if it's something I may be doing wrong.

Thanks in advance.

amitolsys
Champ in-the-making
Champ in-the-making
HI All,
Actually I am using .Net Framework 3.5, and when trying to build the "Samples" Visual C# Project File, then it throws an error for reference "Microsoft.Web.Services3". Can anyone please tell me how can I add this refernce in the project file.

Cheers!
AmitOlsys

rbenedict
Champ in-the-making
Champ in-the-making
I believe you need to download WSE 3.0 (http://www.microsoft.com/downloads/details.aspx?FamilyID=018a09fd-3a74-43c5-8ec1-8d789091255d&displa...) and add the reference to your project.