Skip to content

bug of upload document #1

@zhiqiangwang

Description

@zhiqiangwang

Hi,
I used your code for manage my alfresco repository, I tested the upload document service. But it doesn't work, I used the alfresco 4.1. The follow is test code:

@Test
public void testUploadContent() {
    ContentService contentService = new ContentService(BASE_URL, "admin");
    ContentUploadForm uploadMetadata = new ContentUploadForm();
    FileDataSource fileDataSource =  new FileDataSource("G:\\result.txt");
    uploadMetadata.setFileData(fileDataSource);
    uploadMetadata.setDestination("workspace://SpacesStore/935f540f-8447-49dd-a355-5649d0c6c2d5");
    uploadMetadata.setFileName("result.txt");
    uploadMetadata.setDescription("Test REST upload");

    try {
        System.out.println(contentService.uploadDocument(uploadMetadata));
    } catch (ContentException e) {
        e.printStackTrace();
    }
}

and this is the test results screenshots:
20140219180837

I checked the 'upload.post.js', and found it doesn't received the file object, what's going on?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions