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

Server Implementation #2

Open
YoomamaFTW opened this issue Jan 12, 2020 · 3 comments · Fixed by #4
Open

Server Implementation #2

YoomamaFTW opened this issue Jan 12, 2020 · 3 comments · Fixed by #4
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@YoomamaFTW
Copy link
Collaborator

There needs to be a better way for having server implementation that can cooperate with img and video uploads. Most servers will not be sending base64 encoded img and videos inside their tags, so, instead, the JS should strip the base64 encoded data from the img tags, give them an id (e.g. 0, 1, 2) which will coincide with an array in the JS that a Swift function can access when a required function is called.

We must also be able to offer users the option of saving the base64 inside the HTML instead of stripping it away, in case a user of this package is using this for offline use, as well.

@YoomamaFTW YoomamaFTW added enhancement New feature or request help wanted Extra attention is needed labels Jan 12, 2020
@YoomamaFTW
Copy link
Collaborator Author

YoomamaFTW commented Jan 12, 2020

While implementing the video functionality within RTE, I realized a memory issue would occur by loading so much base64 inside a variable. Many websites only allow one media file to be uploaded. I'm currently reading up on how to upload media files, and, to my dismay...

  • Most people use multipart to send images and videos, which is OK because I doubt a hacker will do anything harmful with an image file... sarcasm
  • The original reason for base64 encoding the file is to avoid any injection. Now that I think about it, it might not be necessary to base64 encode these files like from Videos #1 because the server should be base64 encoding everything, then sending it to an S3 bucket for becoming a normal media file.

Edit: I realized that I should probably mention that most server-users of this package will be using JSON to send data which is why I had that original concern for separate requests sending images and then sending the data itself.

@YoomamaFTW
Copy link
Collaborator Author

Lastly, I might have to have two separate RichTextEditors: one for offline and one for online. The offline one will have to save media files within file manager while the server-based one will have to have some wild functionalities.

@YoomamaFTW YoomamaFTW linked a pull request Feb 29, 2020 that will close this issue
@YoomamaFTW
Copy link
Collaborator Author

YoomamaFTW commented Feb 29, 2020

Resolved the server functionality vs. offline functionality. The server needs to use an HTML parser like BeautifulSoup4. Grab the video tags and identify which ones have IDs. Those that do (should) have base64 encoded videos and can be utilized to upload those videos to AWS S3. This is necessary as a background check so that there is a certain limit on your API.

If the video is simply a link, then there is no id to the video tag. If the video is supposed to be offline, then the base64 is left encoded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant