Uploaded image for project: 'Service Packs and Hot Fixes'
  1. Service Packs and Hot Fixes
  2. MNT-15760

Inconsistent behavior on upload of zero byte files between REST v0 API and FTP

    Details

    • Type: Hot Fix Request
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: 5.0.3
    • Fix Version/s: 5.0.3.1
    • Component/s: ACS REST API
    • Labels:
      None

      Description

      SVN and MVN please.
      Jiras to be included in hotfix: MNT-15757, MNT-15760, MNT-15746, MNT-15662, MNT-15823

      [Problem]
      There appears to be an inconsistency with the way zero-byte files are treated between using REST and FTP. In FTP the file is uploaded and a cm:content property is set, this means that although it points to a zero-byte binary, mime-type is retained. However when uploading via REST, cm:content is not set at all.

      [Steps to reproduce]

      1) Upload a zero byte file by FTP to Alfresco repo

      2) Check the cm:content property using Node Browser: you will see the value being set

      3) Upload a zero byte file using curl

      Example curl command

       # Upload zero byte data to Alfresco
      curl -H "Content-type: application/json" --data '{ "username": "admin", "password": "admin" }' http://localhost:8080/alfresco/service/api/login
      
      curl -F 'filedata=@zerokb.txt' -F 'destination=workspace://SpacesStore/{NodeRef}' http://localhost:8080/alfresco/service/api/upload?alf_ticket=TICKET_22f0626a62c1f9f8d84371e5914266251ae7f75d
      

      4) Check the cm:content property using Node Browser: you will not see a cm:content property being set

      [Expected behavior]

      We should either show the cm:content or not in both the cases.

      [Actual behavior]

      Inconsistent behavior observed as described above.

      When uploading the zero-byte file via FTP, the cm:content property is created as follows:

      Node browser

      Name: cm:content
      Type: d:content
      Value: contentUrl=store://2016/2/29/9/39/47215b01-7226-49b5-b56c-58b9f1225e0d.bin|mimetype=text/plain|size=0|encoding=UTF-32LE|locale=en_GB_|id=686

      This is breaking customers code.
      SVN and MVN please.
      Jiras to be included in hotfix: MNT-15757, MNT-15760, MNT-15746, MNT-15662, MNT-15777, MNT-15823

        Attachments

          Issue Links

            Structure

              Activity

                People

                • Assignee:
                  closedbugs Closed Bugs (Inactive)
                  Reporter:
                  mgazal Mohammed Gazal
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  13 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:

                    Time Tracking

                    Estimated:
                    Original Estimate - Not Specified
                    Not Specified
                    Remaining:
                    Remaining Estimate - 0 minutes
                    0m
                    Logged:
                    Time Spent - 2 days, 6 hours, 30 minutes
                    2d 6h 30m

                      Structure Helper Panel