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
Next revisionBoth sides next revision
protogrid:api_endpoints [2020-05-15 12:47] – [/api/v2/apps/<app_name>/<card_key>/attachments/<attachment_key>] 213.55.241.21protogrid:api_endpoints [2020-05-15 15:08] – [/api/v2/apps/<app_name>/cards/<card_key>/attachments/<attachment_key>] 213.55.241.21
Line 301: Line 301:
 The code behind the attachment upload: The code behind the attachment upload:
 <code javascript> <code javascript>
-var HOST = "https://example.protogrid.com/api/v2/apps/example/attachments/"+var HOST = "https://example.protogrid.com/api/v2/apps/example/cards/some_card_key/attachments/"
 function uploadFile(file, progressCallback, successCallback) { function uploadFile(file, progressCallback, successCallback) {
   var key = createStorageKey(file)   var key = createStorageKey(file)
Line 307: Line 307:
   var xhr = new XMLHttpRequest()   var xhr = new XMLHttpRequest()
  
-  xhr.open("POST", HOST, true)+  xhr.open("POST", HOST+key, true)
  
   xhr.upload.addEventListener("progress", function(event) {   xhr.upload.addEventListener("progress", function(event) {
Print/export