Skip to content

File names containing quotes are not uploaded properly #235

@coderbot16

Description

@coderbot16

I've started to use the consume-dir mode of dsc recently and I dumped a whole load of old documents in. This worked fairly well for the most part (though I had to restart dsc a few times throughout the process because it would time out when uploading a big file) but as I was cataloging the documents today I noticed a few of them were titled integration: No files supplied. When I looked at them, the only attachments were labeled as No name. This seemed very odd, and I had to spend some time going back through the original files I had backed up to figure out what their names used to be.

I started to fix the names and such, by manually reuploading the documents and deleting the broken ones, but a pattern emerged: the files that were broken were the ones that contained a pair of double quotes in their names, such as a file titled Essay on "The Jungle".pdf.

This also seemed to cause the full-text search of Docspell to silently fail with a 422 HTTP code when one of these broken files appears in the results. Since the files are totally missing an attachmentName field, Docspell fails to decode the response:

Caused by: DecodingFailure(Missing required field, List(DownField(attachmentName), DownArray, DownField(docs), DownField(response)))

I only stumbled on this since I tried to search for the content of the documents to see if I could find one with a similar name, but that did not work. Overall this isn't a big issue, but I assume it's a trivial fix as well.

Thanks for your time and making this nice tool!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions