Problem with msword doc file upload

when i upload any image file or pdf file there is no problem. But when i uploading a doc file it converts from .doc to .msword extension. Can you suggest how will i correct it or any methods. I am using adonis js file uploader

That is weird if the conversion happens without you intentionally doing it. The conversion on the fly -during the upload process- can not happen, so there must be some code performs the conversion once the upload ends.
This observation apart, you may share the relevant code and maybe someone could help you.

when i try to change the name with subtype then the problem arrives

this is my code

try {
            const profilePic = request.file('file_doc', {
                types: ['pdf','msword'],
                size: '2mb'
              })
              const fileName = `${new Date().getTime()}.${request.file('file_doc').extname}`
              
              await profilePic.move(Helpers.publicPath('uploads/doc'),{
                name: fileName,
                overwrite: true
              })
            
              console.log('File moved')
        } catch (error) {
            console.log('error')
        }

i changed subtype to extname and it works fine

1 Like

So as I said, the culprit must be the code itself as things do not happen on their own whim :slight_smile: Good you figured it out by yourself :slight_smile:

1 Like