ricecooker
ricecooker copied to clipboard
File uploads should preserve the original filename when possible
Observed behavior
When requesting a file upload URL from Studio, Ricecooker does utilize the original file name, but that is eventually discarded, meaning the filename for cheffed files will default to file
the issue is that ricecooker's implementation of the file upload URL stuff [...] creates the file object to get the upload URL, but then an entirely new file object gets created during the channel upload, so that data gets discarded.
Expected behavior
Ricecooker should use preserve the filename
User-facing consequences
These files end up showing Unknown filename to the end user.
Context
https://github.com/learningequality/studio/issues/4814
Looking at the following bit of code it does appear Ricecooker passes the filename along in its initial request for an upload URL, but according to the above quote, that gets discarded https://github.com/learningequality/ricecooker/blob/b694f3d56ed300b80a77695e975c8009fcd9070f/ricecooker/managers/tree.py#L155-L166
can i contribute to this?
Hi @codesage01, welcome and thanks for volunteering! For several first contributions, please find an unassigned issue labeled as 'help wanted' - that's how we label issues that we have identified as suitable for volunteers. After having long-term experience with our codebases, if you're still interested in this one, you're welcome to message us and we are happy to consider.
ok i will do ... further
As I have been messing about with the File classes in ricecooker, I'm also not actually sure that this attribute ever gets set, except for Graphie files. It's most odd. I am making updates so that this info is persisted, so that we can get it into Studio in the first place, and then this issue can be resolved.