tus-php
tus-php copied to clipboard
Upload fails when file name contains an apostrophe
Hello,
If a file name contains an apostrophe ex. : "i won't upload.jpg" the upload always fails with a 400 error.
I'm using uppy to upload.
Failed to upload tes't.png tus: unexpected response while creating upload, originated from request (method: POST, url: /uploads/, response code: 400, response text: , request id: n/a)
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This is related to #333
Current implementation doesn't allow following characters in filenames '../', '"', "'", '&', '/', '\\', '?', '#', ':'
, however this is not true for all systems and this should be configurable IMO.
As a workaround you can rename the file before uploading, for example with uppy:
onBeforeFileAdded: (currentFile, files) => {
var modifiedFile = Object.assign({}, currentFile, {
name: currentFile.name.replace(" ", "-") // clean spaces
});
uppy.info(modifiedFile);
return modifiedFile;
}