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

Analysis and design of file uploading in the SPA #384

Closed
GPortas opened this issue Apr 24, 2024 · 4 comments
Closed

Analysis and design of file uploading in the SPA #384

GPortas opened this issue Apr 24, 2024 · 4 comments
Assignees
Labels
pm.GREI-d-2.7.1 NIH, yr2, aim7, task1: R&D UI modules for creating datasets and supporting publishing workflows pm.GREI-d-2.7.2 NIH, yr2, aim7, task2: Implement UI modules for creating datasets and publishing workflows Size: 3 A percentage of a sprint. 2.1 hours. SPA: File Upload Page

Comments

@GPortas
Copy link
Contributor

GPortas commented Apr 24, 2024

Overview of the Feature Request

Analyze and design how to implement file uploads in the SPA. Study the existing mechanisms in the API and the options that React offers us to do it in the optimal way.

Some ideas shared in Slack:

From the client side, when uploading a file, we can create an objectUrl to preview the image of the uploaded file from a local blob ( if its an image) else show some icon according to the file extension.

For actually sending those files to the api we will need to create a formData and append every file to it

I’m still not sure how to implement file upload from the client side and if a use case is necessary, or direct API call (or both)

What kind of user is the feature intended for?
Developer

What inspired the request?
Frontend team discussion

What existing behavior do you want changed?
None

Any brand-new behavior do you want to add to Dataverse?
None

Any open or closed issues related to this feature request?
None

@GPortas GPortas added Size: 10 A percentage of a sprint. 7 hours. pm.GREI-d-2.7.1 NIH, yr2, aim7, task1: R&D UI modules for creating datasets and supporting publishing workflows pm.GREI-d-2.7.2 NIH, yr2, aim7, task2: Implement UI modules for creating datasets and publishing workflows SPA: File Upload Page labels Apr 24, 2024
@ekraffmiller
Copy link
Contributor

In the weekly frontend meeting, the feature of direct upload to s3 was discussed as an important feature to implement. There is a javascript component that is used in the current JSF for this. We will need to learn more to evaluate how to add this to the SPA.

@qqmyers
Copy link
Member

qqmyers commented Apr 25, 2024

FWIW: The DVWebloader, which uses ~ the same Javascript and only supports direct upload, might be worth a look too - in that it handles uploading of a whole folder structure and isn't so tied to how PrimeFaces works.

@ekraffmiller
Copy link
Contributor

Another aspect of uploading to review is handling zip files

@GPortas GPortas self-assigned this May 1, 2024
@GPortas
Copy link
Contributor Author

GPortas commented May 8, 2024

After discussion with the core team and the frontend team, we will use the DataFile Direct Upload/Replacement API as the first mechanism supported by the SPA Beta environment for file uploads.

We have decided to start with this mechanism against file system-based storage, as we anticipate that the latter will require evolution to improve its performance. For example, there is currently no API support for uploading multiple files to the file system-based storage, and the single upload option introduces some drawbacks to application performance (e.g., multiple temporary directories saved for a single file, updating db + solr for each file upload... ). In addition, currently the beta environment already supports direct upload.

In the future, we will need to expand support for other mechanisms, including uploading files to file system-based storage. but for now, since the SPA is deployed in beta and not in other installations (which do not necessarily have to use direct upload), this mechanism meets our current goal for Q2, which is to achieve basic file uploads for the SPA.

I have created an issue IQSS/dataverse-client-javascript#152 to work on a use case that encapsulates the logic with all steps required to upload a file using direct upload. We may find potential API extensions when working on this issue, but for now, we'll stick to documentation and examples like dvwebloader to implement the use case.

@GPortas GPortas added Size: 3 A percentage of a sprint. 2.1 hours. and removed Size: 10 A percentage of a sprint. 7 hours. labels May 8, 2024
@GPortas GPortas closed this as completed May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pm.GREI-d-2.7.1 NIH, yr2, aim7, task1: R&D UI modules for creating datasets and supporting publishing workflows pm.GREI-d-2.7.2 NIH, yr2, aim7, task2: Implement UI modules for creating datasets and publishing workflows Size: 3 A percentage of a sprint. 2.1 hours. SPA: File Upload Page
Projects
None yet
Development

No branches or pull requests

3 participants