cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X

Best way to upload Video file to Thingworx Repository via REST API

Velkumar
18-Opal

Best way to upload Video file to Thingworx Repository via REST API

Hi all,

 

Could any one suggest best way to upload Video file to Thingworx Repository using REST API. (File size varies from MB to GB )

 

Thanks in Advance.

 

/VR

1 ACCEPTED SOLUTION

Accepted Solutions

Hello @Velkumar,

 

Here's a basic example using cURL:

curl -v -H "X-XSRF-TOKEN: TWX-XSRF-TOKEN-VALUE" -H "AppKey: $APPKEY" \
  -F "upload-repository=SystemRepository" \
  -F "upload-submit=Upload" \
  -F "file=@myvideo.mp4;type=video/mp4" "$TWXURL/FileRepositoryUploader"

 

Obviously you would need to adjust the filename and MIME type.

 

Regards,
Constantine

View solution in original post

3 REPLIES 3

Hello VR,

 

After doing some digging on this it looks like the video file will need to be converted to a Base 64 format before you can use one of the Save Services available on the File Repository Thing. These Save Services allow you to upload files directly to the repository. See CS236873 for more information on uploading to a File Repository.

 

Your other options to upload the file directly are the File Upload Widget or the File Transfer Subsystem.

Hello @Velkumar,

 

Here's a basic example using cURL:

curl -v -H "X-XSRF-TOKEN: TWX-XSRF-TOKEN-VALUE" -H "AppKey: $APPKEY" \
  -F "upload-repository=SystemRepository" \
  -F "upload-submit=Upload" \
  -F "file=@myvideo.mp4;type=video/mp4" "$TWXURL/FileRepositoryUploader"

 

Obviously you would need to adjust the filename and MIME type.

 

Regards,
Constantine

slangley
23-Emerald II
(To:Velkumar)

Hi @Velkumar.

 

If one of the previous responses allowed you to find a solution, please mark the appropriate one as the Accepted Solution for the benefit of others with the same issue.

 

Thank you for participating in our community!

 

Regards.

 

--Sharon

Top Tags