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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

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

Velkumar
19-Tanzanite

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

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

Announcements


Top Tags