balderdashy / sails

Realtime MVC Framework for Node.js
https://sailsjs.com
MIT License
22.81k stars 1.95k forks source link

Skipper: File extension not appending #4710

Open masious opened 5 years ago

masious commented 5 years ago

Hi, When I receive the uploaded file using .upload, the file extension is not appended to the file.fd. Here is my code:

    this.req.file('photo').upload({
      dirname: require('path').resolve(sails.config.appPath, 'assets/images')
    }, async (err, [file]) => {
      if (err) {
        return exits.serverError(err);
      }
      console.log(file);
    });

According to the docs, it should append the extension by default. Is it something that I do wrong? Or is it some problem with the Skipper?

sailsbot commented 5 years ago

@masious Thanks for posting, we'll take a look as soon as possible. In the meantime, if you haven’t already, please carefully read the issue contribution guidelines and double-check for any missing information above. In particular, please ensure that this issue is about a stability or performance bug with a documented feature; and make sure you’ve included detailed instructions on how to reproduce the bug from a clean install. Finally, don’t forget to include the version of Node.js you tested with, as well as your version of Sails or Waterline, and of any relevant standalone adapters/generators/hooks.

Thank you!


For help with questions about Sails, click here. If you’re interested in hiring @sailsbot and her Austin-based minions, click here.

raqem commented 5 years ago

Hi @masious, Just wanted to let you know we are moving all open Sails issue into one repo. ~Cheers!

raqem commented 5 years ago

Hi @masious thank you for bring this issue to light. Have you been able to find a solution to this issue? Also could you point me to the section in the Docs you are referring to? Was it in the uploads section?

masious commented 5 years ago

Hi @raqem. I was not able to find a solution. I ended up hard-coding the extension! No, I was referring to this. In saveAs description, it's said that:

By default, Skipper decides an "at-rest" filename for your uploaded files (called the fd) by generating a UUID and combining it with the file's original file extension when it was uploaded