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

[feature]: Large file upload #302

Open
1 task done
zhangtao25 opened this issue May 27, 2023 · 3 comments
Open
1 task done

[feature]: Large file upload #302

zhangtao25 opened this issue May 27, 2023 · 3 comments
Labels
CodeDay Issues and PRs associated with the CodeDay Labs partnership

Comments

@zhangtao25
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Summary

When using the chorme extensions proxy to upload files, due to the limitations of the chrome extensions, the file cannot be serialized, which requires a base64 encoding before transferring data through postmessage, resulting in large files being unable to be uploaded and used on the hoppscotch.

Why should this be worked on?

Support for uploading large files on hoppscotch.

@amk-dev amk-dev transferred this issue from hoppscotch/hoppscotch Jul 4, 2024
@amk-dev amk-dev added the fosshack Reserved for FOSS Hack Partner Projects Programme label Jul 4, 2024
@semi-infiknight
Copy link

Hi, I have taken part in FOSS Hack 2024 and have taken an interest in this issue. My approach for solving this issue would be to use chunked file uploading.

Please assign me this issue so that I can start working on it.

@amk-dev
Copy link
Collaborator

amk-dev commented Jul 22, 2024

Hey @semi-infiknight

sorry for the late reply. you can work on this. i'll give some additional context also,

so right now the process of transfering a file to the extension looks like this,

hoppscotch website -> hookContent.js -> contentScript -> serviceWorker -> sents the request.

the bottleneck is in the contentScript, it uses the chrome.runtime.sendMessage which can only transfer JSON serializable values. the window.postMessage supports the StructuredCloneAlgorithm which supports the File object. we can use postMessage in hookContent.js, so we can transfer the file till contentScript with this. but from there we need to use chrome.runtime.sendMessage which only accepts JSON serializable values.

there are some paths you could explore to solve this. linking the ongoing discussion about this topic here. there are some workarounds listed there. you'll need to explore these before going the splitting the file and rejoining path. you can use it as a last resort.

w3c/webextensions#293

@SanskritiHarmukh SanskritiHarmukh added CodeDay Issues and PRs associated with the CodeDay Labs partnership and removed fosshack Reserved for FOSS Hack Partner Projects Programme testmu labels Nov 4, 2024
@rifflere
Copy link

I'm working on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CodeDay Issues and PRs associated with the CodeDay Labs partnership
Projects
None yet
Development

No branches or pull requests

5 participants