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

Upload fails when file name contains an apostrophe #397

Open
gavrochelegnou opened this issue Jun 20, 2022 · 2 comments
Open

Upload fails when file name contains an apostrophe #397

gavrochelegnou opened this issue Jun 20, 2022 · 2 comments
Labels

Comments

@gavrochelegnou
Copy link

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)

@github-actions
Copy link

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.

@ankitpokhrel
Copy link
Owner

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;
}

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

No branches or pull requests

2 participants