Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
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
Solved! Go to Solution.
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
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
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