Error loading unsigned video from mobile app
Hey there!
I'm trying uploading video through react native but the response status is 400, "Invalid image file".
resource_type set to 'video'.
this is the request intersting part:
body:
{ resource_type: 'video',
upload_preset: 'sites-media-dev',
public_id: 'rabbelrabbel.mp4' },
files:
{ file:
{ fieldName: 'file',
originalFilename: 'rabbel.mp4',
path: '/tmp/rabbel.mp4',
headers: [Object],
size: 9564568,
name: '2760b880-a305-409b-b2e7-97af2038c732.mp4',
type: 'video/mp4' } },
_body: true,
{ resource_type: 'video',
upload_preset: 'sites-media-dev',
public_id: 'rabbelrabbel.mp4' },
files:
{ file:
{ fieldName: 'file',
originalFilename: 'rabbel.mp4',
path: '/tmp/rabbel.mp4',
headers: [Object],
size: 9564568,
name: '2760b880-a305-409b-b2e7-97af2038c732.mp4',
type: 'video/mp4' } },
_body: true,
P.S. Uploading images works perfectly even when resource_type set to video
0
-
I'm sorry for the delay in our response.
You can directly use our API for uploads. Please see this fiddle for a code example of such upload process (simply add your cloud_name and fill an upload preset) -
http://jsfiddle.net/fw9pty0v/Hope this helps, please let me know if you have any further questions.
0
Post is closed for comments.
Comments
1 comment