How to restrict other file being uploaded except mp3 file - mp3

I Want to upload only mp3 files in my project but
When i change extension of an docs file to mp3 it is also uploading easily.
Could i get any code which restrict any such file being uploded..

Related

image file cant upload to postman

I am using postman(9.31.13) and I have got the following warning when I upload the file to send the body as a form-data.
"This file isn't in your working directory. Teammates you share this request with won't be able to use this file. To make collaboration easier you can set up your working directory in Settings." How can I solve it?

Download multiple files with one link as zipped file django

I have a model with multiple files that when I get an object from it I want to be able to download all its related files from one click on anchor as a zip file

Ionic 2: Uploading file from google drive/cloud to my own server

In my application I have a functionality where user can upload his resume(of format .doc,.docx,.pdf). I'm using Ionic File Choosing plugin to choose the file and to upload I'm using Ionic File Transfer plugin. It is known that the file transfer plugin expects fileName filed in FileUploadOptions which will be the name of file to be uploaded with it's extension. In my case say resume.pdf/doc/docx.
For getting the file extension I'm passing the chosen file's path to Ionic File Path plugin which will resolve it to it's native path.
The whole process is working absolutely fine when the file is chosen from mobile's native file system.
But when the file is chosen from drive/cloud application the Ionic File Path plugin throws error cannot be resolved to native path.
As I'm not able to resolve file path to it's native path I'm not getting file's extension.
When I'm not aware of file's extension it is not possible to upload the file to my server. (if I keep filename field empty in FileUploadOptions, by default name.jpg will be taken which may not be the type of file that I'm trying to upload).
Please suggest how can I get the extension of file that is chosen from drive or how can I upload a file without default filename field in FileUploadOptions.
7.It's similar to this question ionic 2 How to download file from Google Drive and I-cloud as there is no proper answer for this question I'm reposting it with further explanation.
Finally I found solution for this problem. I have created a public github gist where I have explained the solution. The link for it is as below
https://gist.github.com/coolvasanth/d042a26deda75f5e390b42b87995f30d

Shiny: Uploading local files to server from client

I use fileInput to upload one file which contains the paths and file names of multiple files on my local computer.
I would then like to use these file paths and upload them to the server directly without the user having to perform any more interaction.
So simply put how do I upload a file to the shiny server I already know its local path?

Django application to upload videos on S3 using boto3

I am new to Django and want to develop an application to upload videos on AWS S3 using Boto3.
Please guide me step-by-step on how to implement this?
As I am new it's little hard for me to understand.
Earlier I tried and created one Form with form.FileField() and it returns File Object but that fileobject I am not able to upload using boto3 as upload_fileObj method must require read implemented as a rb.
Thanks in advance and waiting for guidance.
You should first create a file from your File Object in /tmp/ directory.
After that you can use that file path to upload using upload_file
once you are sure that the file is uploaded successfully you can delete that file from /tmp/ directory.
Incase, file is not being properly uploaded you can retry it also.