Any update on this? I'm having the same issue.

On Wednesday, February 10, 2016 at 2:53:20 PM UTC+3:30, Elektronac wrote:
>
> Hi,
>
> I have a problem with DSpace REST service when i upload bitstream file.
> When I upload file, additional header is embedded inside of that bitstream 
> file. 
> Because of that embedded header I am not able to view file from DSpace.
> When I download bitstream file from DSpace, open it and erase header (from 
> notepad) i can view content of this file. 
>
> Do you have any sugestion how can I solve this problem?
>
>
> Code for calling the DSpace REST service:
>
>
> HttpPost post = new HttpPost(base_url + 
> "items/1/bitstreams?name=image.png&description=myTestiImage");
>
> post.setHeader("rest-dspace-token",token);
> post.addHeader("Content-Type", "multipart/form-data");
> post.addHeader("Accept", "image/png");
>
>
> MultipartEntity builder = new 
> MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);
>
> String path = "D:/image.png";
> File postFile = new File(path);
> FileBody cbFile = new FileBody(postFile);
>
> builder.addPart("data", cbFile);
>
> post.setEntity(builder);
> System.out.println("executing request " + post.getRequestLine());
>
> HttpResponse response = client.execute(post);
>
> ...
>
> File header before upload:
>
> ‰PNG
> ...
>
>
> Bitstream file header after uopload:
>
> --AueSc1EQFoTUiaqVs7YQOgeVdx3wqdf2E0
> Content-Disposition: form-data; name="someName"; filename="image.png"
> Content-Type: image/png
> Content-Transfer-Encoding: binary
>
> ‰PNG
> ...
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dspace-tech+unsubscr...@googlegroups.com.
To post to this group, send email to dspace-tech@googlegroups.com.
Visit this group at https://groups.google.com/group/dspace-tech.
For more options, visit https://groups.google.com/d/optout.

Reply via email to