You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello i am trying to upload a video to cloudinary but i keep getting this error Traceback (most recent call last): File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner response = get_response(request) File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/contrib/admin/options.py", line 614, in wrapper return self.admin_site.admin_view(view)(*args, **kwargs) File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/utils/decorators.py", line 130, in _wrapped_view response = view_func(request, *args, **kwargs) File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func response = view_func(request, *args, **kwargs) File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/contrib/admin/sites.py", line 233, in inner return view(request, *args, **kwargs) File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/contrib/admin/options.py", line 1656, in change_view return self.changeform_view(request, object_id, form_url, extra_context) File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/utils/decorators.py", line 43, in _wrapper return bound_method(*args, **kwargs) File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/utils/decorators.py", line 130, in _wrapped_view response = view_func(request, *args, **kwargs) File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/contrib/admin/options.py", line 1534, in changeform_view return self._changeform_view(request, object_id, form_url, extra_context) File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/contrib/admin/options.py", line 1580, in _changeform_view self.save_model(request, new_object, form, not add) File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/contrib/admin/options.py", line 1093, in save_model obj.save() File "/home/otchere-dev/Desktop/Programming/Django/incompleted projects/udemy_clone/courses/models.py", line 113, in save return super().save(*args, **kwargs) File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/db/models/base.py", line 753, in save self.save_base(using=using, force_insert=force_insert, File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/db/models/base.py", line 790, in save_base updated = self._save_table( File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/db/models/base.py", line 869, in _save_table values = [(f, None, (getattr(self, f.attname) if raw else f.pre_save(self, False))) File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/db/models/base.py", line 869, in <listcomp> values = [(f, None, (getattr(self, f.attname) if raw else f.pre_save(self, False))) File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/db/models/fields/files.py", line 307, in pre_save file.save(file.name, file.file, save=False) File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/db/models/fields/files.py", line 87, in save self.name = self.storage.save(name, content, max_length=self.field.max_length) File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/core/files/storage.py", line 52, in save return self._save(name, content) File "/home/otchere-dev/.local/lib/python3.8/site-packages/cloudinary_storage/storage.py", line 68, in _save response = self._upload(name, content) File "/home/otchere-dev/.local/lib/python3.8/site-packages/cloudinary_storage/storage.py", line 62, in _upload return cloudinary.uploader.upload(content, **options) File "/home/otchere-dev/.local/lib/python3.8/site-packages/cloudinary/uploader.py", line 46, in upload return call_cacheable_api("upload", params, file=file, **options) File "/home/otchere-dev/.local/lib/python3.8/site-packages/cloudinary/uploader.py", line 394, in call_cacheable_api result = call_api(action, params, http_headers, return_error, unsigned, file, timeout, **options) File "/home/otchere-dev/.local/lib/python3.8/site-packages/cloudinary/uploader.py", line 477, in call_api raise Error(result["error"]["message"]) cloudinary.exceptions.Error: Unsupported video format or file
Below is the model class Episode(models.Model): title=models.CharField(max_length=225) file=models.FileField(upload_to='courses',validators=[validate_video],storage=VideoMediaCloudinaryStorage()) length=models.DecimalField(max_digits=100,decimal_places=2)
When i try uploading the same video as a rawfile it works but i can play it in the browser and also image uploading aslo works perfectly.
Please any help would be really be appreciated. Thank you
The text was updated successfully, but these errors were encountered:
It is very hard to help you without any additional info. I can see Unsupported video format or file error, but you say it is for any file. It would be very weird if that was the case, otherwise many people would complain about it.
Hello i am trying to upload a video to cloudinary but i keep getting this error
Traceback (most recent call last): File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/core/handlers/exception.py", line 47, in inner response = get_response(request) File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/core/handlers/base.py", line 181, in _get_response response = wrapped_callback(request, *callback_args, **callback_kwargs) File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/contrib/admin/options.py", line 614, in wrapper return self.admin_site.admin_view(view)(*args, **kwargs) File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/utils/decorators.py", line 130, in _wrapped_view response = view_func(request, *args, **kwargs) File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/views/decorators/cache.py", line 44, in _wrapped_view_func response = view_func(request, *args, **kwargs) File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/contrib/admin/sites.py", line 233, in inner return view(request, *args, **kwargs) File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/contrib/admin/options.py", line 1656, in change_view return self.changeform_view(request, object_id, form_url, extra_context) File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/utils/decorators.py", line 43, in _wrapper return bound_method(*args, **kwargs) File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/utils/decorators.py", line 130, in _wrapped_view response = view_func(request, *args, **kwargs) File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/contrib/admin/options.py", line 1534, in changeform_view return self._changeform_view(request, object_id, form_url, extra_context) File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/contrib/admin/options.py", line 1580, in _changeform_view self.save_model(request, new_object, form, not add) File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/contrib/admin/options.py", line 1093, in save_model obj.save() File "/home/otchere-dev/Desktop/Programming/Django/incompleted projects/udemy_clone/courses/models.py", line 113, in save return super().save(*args, **kwargs) File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/db/models/base.py", line 753, in save self.save_base(using=using, force_insert=force_insert, File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/db/models/base.py", line 790, in save_base updated = self._save_table( File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/db/models/base.py", line 869, in _save_table values = [(f, None, (getattr(self, f.attname) if raw else f.pre_save(self, False))) File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/db/models/base.py", line 869, in <listcomp> values = [(f, None, (getattr(self, f.attname) if raw else f.pre_save(self, False))) File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/db/models/fields/files.py", line 307, in pre_save file.save(file.name, file.file, save=False) File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/db/models/fields/files.py", line 87, in save self.name = self.storage.save(name, content, max_length=self.field.max_length) File "/home/otchere-dev/.local/lib/python3.8/site-packages/django/core/files/storage.py", line 52, in save return self._save(name, content) File "/home/otchere-dev/.local/lib/python3.8/site-packages/cloudinary_storage/storage.py", line 68, in _save response = self._upload(name, content) File "/home/otchere-dev/.local/lib/python3.8/site-packages/cloudinary_storage/storage.py", line 62, in _upload return cloudinary.uploader.upload(content, **options) File "/home/otchere-dev/.local/lib/python3.8/site-packages/cloudinary/uploader.py", line 46, in upload return call_cacheable_api("upload", params, file=file, **options) File "/home/otchere-dev/.local/lib/python3.8/site-packages/cloudinary/uploader.py", line 394, in call_cacheable_api result = call_api(action, params, http_headers, return_error, unsigned, file, timeout, **options) File "/home/otchere-dev/.local/lib/python3.8/site-packages/cloudinary/uploader.py", line 477, in call_api raise Error(result["error"]["message"]) cloudinary.exceptions.Error: Unsupported video format or file
Below is the model
class Episode(models.Model): title=models.CharField(max_length=225) file=models.FileField(upload_to='courses',validators=[validate_video],storage=VideoMediaCloudinaryStorage()) length=models.DecimalField(max_digits=100,decimal_places=2)
When i try uploading the same video as a rawfile it works but i can play it in the browser and also image uploading aslo works perfectly.
Please any help would be really be appreciated. Thank you
The text was updated successfully, but these errors were encountered: