Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
dev:web_api:v3:file_upload [2015/03/10 23:57] – [Zotero Web API File Uploads] dstillmandev:web_api:v3:file_upload [2021/10/21 14:21] (current) – [ii. Register upload] dstillman
Line 44: Line 44:
     "tags": [],     "tags": [],
     "relations": {},     "relations": {},
-    "contentType": "",+    "contentType": "application/pdf",
     "charset": "",     "charset": "",
-    "filename": "",+    "filename": "doc.pdf",
     "md5": null,     "md5": null,
     "mtime": null     "mtime": null
Line 52: Line 52:
 ]</code> ]</code>
  
-''contentType'', ''charset'', ''filename'', ''md5''and ''mtime'' can be edited directly in personal libraries for WebDAV-based file syncing. They cannot be edited directly in group libraries and should not be edited directly in personal libraries using Zotero File Storage, which provides an atomic method (detailed below) for setting the properties along with the corresponding file+''md5'' and ''mtime'' can be edited directly in personal libraries for WebDAV-based file syncing. They should not be edited directly when using Zotero File Storage, which provides an atomic method (detailed below) for setting the properties along with the corresponding file.
- +
-Top-level attachments can be created by excluding the ''parentItem'' property or setting it to ''false''. As in the Zotero client, only file attachments and PDFs — not HTML snapshots or web links — can be added as top-level items.+
  
 +Top-level attachments can be created by excluding the ''parentItem'' property or setting it to ''false''. Though the API allows all attachments to be made top-level items for backward-compatibility, it is recommended that only file attachments (''imported_file''/''linked_file'') and PDF imported web attachments (''imported_url'' with content type ''application/pdf'') be allowed as top-level items, as in the Zotero client.
 ===== 1b) Modify an existing attachment ===== ===== 1b) Modify an existing attachment =====
  
Line 83: Line 82:
   }   }
 } }
-</content> 
 </code> </code>
  
Line 105: Line 103:
   If-None-Match: *   If-None-Match: *
  
-  md5=<hash>&filename=<filename>&filesize=<bytes>&mtime=<milliseconds>[&contentType=<type>&charset=<charset>]+  md5=<hash>&filename=<filename>&filesize=<bytes>&mtime=<milliseconds>
  
 For existing attachments, use ''If-Match: <hash>'' in place of ''If-None-Match: *'', where <hash> is the previous MD5 hash of the file (as provided in the ''ETag'' header when downloading it). For existing attachments, use ''If-Match: <hash>'' in place of ''If-None-Match: *'', where <hash> is the previous MD5 hash of the file (as provided in the ''ETag'' header when downloading it).
Line 163: Line 161:
  
  
-After the upload has been registered, the attachment item will reflect the new metadata.+After the upload has been registered, the attachment item will reflect the new metadata (''filename'', ''mtime'', ''md5'').
  
  
dev/web_api/v3/file_upload.1426046251.txt.gz · Last modified: 2015/03/10 23:57 by dstillman