Fix Base64 file upload failing on read-only filesystems#175
Open
Fix Base64 file upload failing on read-only filesystems#175
Conversation
…or Base64 uploads Replace os.Create(request.FileName) with os.CreateTemp to create temporary files in the OS temp directory instead of the current working directory. This fixes failures in containers with read-only filesystems. Also adds explicit FileName validation when Base64 is provided, and uses file.Name() for the os.Remove call to correctly reference the temp file. Co-authored-by: jstjoe <2015604+jstjoe@users.noreply.github.com> Agent-Logs-Url: https://github.com/skyflowapi/skyflow-go/sessions/d8435c8e-77d9-4774-9041-b8ea37a9977b
Co-authored-by: jstjoe <2015604+jstjoe@users.noreply.github.com> Agent-Logs-Url: https://github.com/skyflowapi/skyflow-go/sessions/d8435c8e-77d9-4774-9041-b8ea37a9977b
…tion Co-authored-by: jstjoe <2015604+jstjoe@users.noreply.github.com> Agent-Logs-Url: https://github.com/skyflowapi/skyflow-go/sessions/d8435c8e-77d9-4774-9041-b8ea37a9977b
Copilot created this pull request from a session on behalf of
jstjoe
March 25, 2026 23:24
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GetFileForFileUploadusesos.Create(request.FileName)to materialize Base64-decoded data, writing to CWD. This fails in containers with read-only filesystems:Changes
os.Create→os.CreateTemp— temp file created in OS temp dir (/tmp) instead of CWDos.Remove(request.FileName)→os.Remove(file.Name())— reference actual temp path for cleanupBase64is set butFileNameis empty (previously fell through toos.Create(""))FileNameto exercise the decode path rather than hitting the new validation