Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Aws Controller - uploadToAws - wrong extensions #1

Open
karl-thomas opened this issue Aug 21, 2018 · 0 comments
Open

Aws Controller - uploadToAws - wrong extensions #1

karl-thomas opened this issue Aug 21, 2018 · 0 comments

Comments

@karl-thomas
Copy link

karl-thomas commented Aug 21, 2018

The method to determine the extension of a file is incorrect in the Aws controller.
Currently it looks at the mimetype, takes whatever text is in the mimetype and puts that as the file extension.

  let pattern = /\.[0-9a-z]+$/i;
  let foundFileExt = fileName.match(pattern);
  if (!foundFileExt) {
    // Get the file extension from the mimetype
    let fileExt = file.mimetype.substr(file.mimetype.indexOf('/') + 1);

    // Add to the fileName
    fileName += `.${fileExt}`;
  }

this is incorrect, as many mimetypes are not proper file extensions, and if we set a default for the mimetypes, like many projects do for videos, than it will not be correct at all. For example, we upload a video on Iphone, it's probably a quicktime video, then we set a default mimetype of mp4. Quicktime videos Dont stream on Android, and now we don't know why the video wont work because it's labeled as an mp4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant