AnsweredAssumed Answered

upload a file via webdav using POST form corrupt file

Question asked by sjeandroz on Mar 11, 2015

I would like to upload a new file (or update an existing) using an html form, with input type=file. My form looks like this:

<form style="" action="http://myserver:8080/alfresco/webdav/Sites/Groupes/Financement/ca.txt" enctype='multipart/form-data' method="POST" accept-charset="UTF-8">
     <input name="file" class="hiddenFileField"  type="file" id="fileupload" />
     <input type="submit" value="submit" />                                                  

When I submit the form, a file is created on the right place but the file is corrupted. For exemple if I tried to upload a .txt file with the following content :
The file content!!

On my server I will have a file wich contains:

Content-Disposition: form-data; name="file"; filename="ca.txt"
Content-Type: text/plain

The file content!!


Is there a specific configuration to allow uploading file with POST form? Is there a specific attribute I must add on my form? (encoding?)

Thanks for your help and sorry for my bad english…