POSTMAN upload to user home results in zero byte file
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-12-2013 12:44 PM
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
ort/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
ort
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
Here's what I'm sending vi POSTMAN
Request URL: http://alfrescoserverip

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

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
Labels:
- Labels:
-
Archive
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2013 09:49 AM
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:
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:
