LibKGAPI allows specifying the mimeType of an upload via the associated KGAPI2::Drive::File.
This is required in uploads where the data isn't sufficient in determining the mime-type (i.e. docx files as reported in BUG 401151).
BUG: 401151
LibKGAPI allows specifying the mimeType of an upload via the associated KGAPI2::Drive::File.
This is required in uploads where the data isn't sufficient in determining the mime-type (i.e. docx files as reported in BUG 401151).
BUG: 401151
No Linters Available |
No Unit Test Coverage |
Buildable 14239 | |
Build 14257: arc lint + arc unit |
Can you expland a bit the commit message explaining how does libkgapi use the filename?
src/kio_gdrive.cpp | ||
---|---|---|
746 | Doesn't this result in temp files such as /tmp/XXXXXXfoo.txt ? Don't we need a slash between the template and the filename? |
src/kio_gdrive.cpp | ||
---|---|---|
746 | Ah right. Can we use a - as separator then? ( /tmp/XXXXXX-foo.txt ) |
src/kio_gdrive.cpp | ||
---|---|---|
746 | Maybe the LibKGAPI API should be extended to allow the caller to specify the mime type, because the caller is always more knowledgable about the file than LibKGAPI, and use QMimeDatabase::mimeTypeForFileNameAndData() just as a fallback when caller doesn't provide the mime type. Putting the real filename into /tmp is a potential privacy leak - other users of the system might be able to see what you are uploading. |
src/kio_gdrive.cpp | ||
---|---|---|
746 | That indeed seems like a better idea. I'll look into that and try to also tackle the TODO at line 666 of this file. // TODO: Instead of using a temp file, upload directly the raw data (requires // support in LibKGAPI) |