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

Open
opened 2017-07-21 13:30:23 +00:00 by spwizard · 3 comments
spwizard commented 2017-07-21 13:30:23 +00:00 (Migrated from github.com)

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

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
Ekaanth commented 2017-12-11 11:30:09 +00:00 (Migrated from github.com)

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

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
MrfksIv commented 2017-12-21 08:45:21 +00:00 (Migrated from github.com)

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: ""
}
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: "" } ```
UrielMiranda commented 2018-05-14 00:24:44 +00:00 (Migrated from github.com)

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']
   }
);
My configuration for csv files only, in Mac/Windows, works fine in both @spwizard thanks to @MrfksIv for his explain ```JS public uploader: FileUploader = new FileUploader( { url: @'' allowedMimeType: ['application/csv', 'text/csv', 'application/vnd.ms-excel'] } ); ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: dc/ng2-file-upload#850