ricecooker icon indicating copy to clipboard operation
ricecooker copied to clipboard

File uploads should preserve the original filename when possible

Open bjester opened this issue 1 year ago • 4 comments

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

bjester avatar Nov 14 '24 18:11 bjester

can i contribute to this?

codesage01 avatar Dec 07 '24 07:12 codesage01

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.

MisRob avatar Dec 12 '24 18:12 MisRob

ok i will do ... further

codesage01 avatar Dec 13 '24 10:12 codesage01

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.

rtibbles avatar Jan 25 '25 01:01 rtibbles