AnsweredAssumed Answered

POSTMAN upload to user home results in zero byte file

Question asked by chuyser on Jul 12, 2013
Latest reply on Jul 15, 2013 by chuyser
I'm prototyping upload of a document to the user's home directory (User Homes/{username} using Chrome's POSTMAN. The upload returns a SUCCESS status, with the node number for the file, etc., but the resulting file node contains a 0 byte stub. The ticket I'm using is for the user to whose home directory I am trying to upload.

Here's what I'm sending vi POSTMAN

Request URL: http://alfrescoserverip:port/alfresco/service/api/upload?alf_ticket=TICKET_ticketnum
Request Method: POST
Status Code: 200 OK

Request Headers:
Accept: */*
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8
Cache-Control: no-cache
Connection: keep-alive
Content-Length: 1273
Content-Type: multipart/form-data; boundary …
Cookie: JSESSIONID=…; sessionid=…;csrftoken=…
Host: alfrescoserverip:port
Origin: chrome-extension…
User-Agent: Mozilla/5.0 …

Query String Parameters:
alf_ticket: TICKET_ticketnum

Request Payload:
filedata: filename="somefile.txt" Content-Type:text/plain
description: user home upload
contentType: cm:content
thumbnails: doclib
overwrite: false
destination: workspace://SpacesStore/node_number_for_user_home_directory

And here's what I get back:

   "nodeRef": "workspace://SpacesStore/new_file_node_number_XXXX",
   "fileName": "somefile.txt",
      "code": 200,
      "name": "OK",
      "description": "File uploaded successfully"

I checked in the alfresco logs, but didn't see any issues. Any thoughts on what's wrong with my syntax? I will eventually want to do this operation both via a Web script and via CURL.

I am running Alfresco Community Edition, version 4.0.d.

Thank you,
Cindy Huyser