-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upload file from string or file-like object #5
Comments
Similarly, I just realised that in simple_upload, the targetPath must be a folder (and the file will get the same filename as the source file). Is it possible to specify instead the destination filename? (This actually prevents even using a NamedTemporaryFile, I have to use a TemporaryDirectory and create a file with the correct name, and then transfer to the folder). Even if there is no plan to change it, I suggest to clarify the docstring (now it says |
The method
simple_upload(self, machine, sourcePath, targetPath)
requires the source file to be an actual file on disk. There are cases (e.g. uploading a simple short text file) where the content is in memory (in a string, or in a file-like object - e.g. an already open file). Would it be possible to support passing the content or a file-like object, or this is complicated? (For now, I need to create a NamedTemporaryFile to upload the content, is this the suggested approach?)The text was updated successfully, but these errors were encountered: