cancel
Showing results for 
Search instead for 
Did you mean: 

POSTMAN upload to user home results in zero byte file

chuyser
Champ in-the-making
Champ in-the-making
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://alfrescoserveripSmiley Tongueort/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: alfrescoserveripSmiley Tongueort
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
siteid:
containerid:
uploadDirectory:
description: user home upload
contentType: cm:content
thumbnails: doclib
overwrite: false
destination: workspace://SpacesStore/node_number_for_user_home_directory
username:
majorVersion:

And here's what I get back:

Response:
{
   "nodeRef": "workspace://SpacesStore/new_file_node_number_XXXX",
   "fileName": "somefile.txt",
   "status":
   {
      "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
1 REPLY 1

chuyser
Champ in-the-making
Champ in-the-making
I had success this morning with uploading a document to the user space. It looks like I was missing the (empty) updateNodeRef parameter. So the final list of payload parameters should be:

filedata: filename="somefile.txt" Content-Type:text/plain
siteid:
containerid:
uploadDirectory:
description: user home upload
contentType: cm:content
thumbnails: doclib
overwrite: false
destination: workspace://SpacesStore/node_number_for_user_home_directory
username:
majorVersion:
updateNodeRef: