Skip to content
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

update uploadFile method to accept buffer #221

Open
moonway-dev opened this issue Aug 3, 2024 · 4 comments · May be fixed by #280
Open

update uploadFile method to accept buffer #221

moonway-dev opened this issue Aug 3, 2024 · 4 comments · May be fixed by #280
Assignees
Labels
component:js sdk Issue/PR related to JavaScript SDK status:triaged Issue/PR triaged to the corresponding sub-team type:feature request New feature request/enhancement

Comments

@moonway-dev
Copy link

Description of the feature request:

Please make uploadFile able to accept buffer or url, uploading from a local machine is very limiting.

What problem are you trying to solve with this feature?

This will help loading files in Express JS or Spring Boot

Any other information you'd like to share?

No response

@singhniraj08 singhniraj08 added type:feature request New feature request/enhancement status:triaged Issue/PR triaged to the corresponding sub-team component:js sdk Issue/PR related to JavaScript SDK labels Aug 6, 2024
@tanaikech
Copy link

tanaikech commented Aug 26, 2024

How about this script? This Node.js script demonstrates how to implement resumable uploads using streams with various APIs, such as Gemini, Drive, YouTube, and more. It supports uploading files from both local paths and remote URLs. I originally created this for use with Gemini API and remote file URLs. I hope you find it helpful.

https://github.com/tanaikech/resumableUploadForGoogleAPIs_nodejs

Or, https://stackoverflow.com/a/78873910

@luisiacc
Copy link

I think this would be a very simple change that allows all ways to upload files. To use this in production I'm having to create a temporary file from the buffer and then passing the temporary file path on to the function, which is not good at all, if they are big files and there are a lot of concurrent ones, the storage could get filled quickly.

@luisiacc
Copy link

Even better if you the gemini endpoint can accept a url to upload the file, that way we don't even have to keep the buffer in memory, we can just upload something like an s3 presigned url.

@thorwebdev
Copy link

Agreed, imagine a environment where the isn't any fs, I'd just like to pass in a publicly accessible URI!

@thorwebdev thorwebdev linked a pull request Oct 16, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component:js sdk Issue/PR related to JavaScript SDK status:triaged Issue/PR triaged to the corresponding sub-team type:feature request New feature request/enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants