ng2-file-upload icon indicating copy to clipboard operation
ng2-file-upload copied to clipboard

Not working correctly allowedMimeType: ['text/plain', 'text/csv']

Open spwizard opened this issue 8 years ago • 4 comments

I only want users to be able to upload .csv files. I first implemented 'text/csv' which on a max/osx worked fine, but on windows chrome, it will not allow users to upload .csv files. I assume its because it docent recognise css. I tried a work around of allowing .txt files but this on windows chrome will still only allow txt extensions.

How can I get windows chrome to accept csv files only

spwizard avatar Jul 21 '17 13:07 spwizard

when I provide mime-type for pdf it is uploading but when I provide for doc and docx documents are not getting uploaded. Is there a way around to tackle this problem. (Till this issue is fixed).

public allowedMimeType = [''application/pdf'']; uploader: FileUploader = new FileUploader({ allowedFileType: this.allowedMimeType, isHTML5: true });

this code is working perfectly fine, but when I provide mime type for doc and docx it's not working as it supposed to be.

mime-type provided for doc and docx file.

.doc application/msword .docx application/vnd.openxmlformats-officedocument.wordprocessingml.document

Ekaanth avatar Dec 11 '17 11:12 Ekaanth

I am facing the same problem. I believe it has something to do with the file type that microsoft office opposes on .csv files. After checking the file details that I attempted to upload I noticed that the type was of application/vnd.ms-excel instead of text/csv:

{
  lastModified: 1496154311657,
  lastModifiedDate: Tue May 30 2017 17:25:11 GMT+0300 (GTB Daylight Time) {},
  name: "a173916a-64bf-46e6-8d21-05a4b7dae381.csv",
  size: 29310,
  type: "application/vnd.ms-excel",
  webkitRelativePath: ""
}

MrfksIv avatar Dec 21 '17 08:12 MrfksIv

My configuration for csv files only, in Mac/Windows, works fine in both @spwizard thanks to @MrfksIv for his explain

public uploader: FileUploader = new FileUploader(
    {
      url:  @''
      allowedMimeType: ['application/csv', 'text/csv', 'application/vnd.ms-excel']
   }
);

UrielMiranda avatar May 14 '18 00:05 UrielMiranda

Just in case someone is trying to use the "allowedMimeType" to allow .mov files.

Try allowedMimeType: ['video/quicktime']

took me quite a while to get this info

TheMorne avatar Jan 27 '23 12:01 TheMorne