writefreely icon indicating copy to clipboard operation
writefreely copied to clipboard

Add file uploading and file sharing functionality

Open alborzjafari opened this issue 2 years ago • 6 comments

  • I need to upload media files such as images and use them in markdown format. I have added this feature in this pull request.
  • It is configurable using config.ini file to activate or deactivate this feature in the instance. It is disabled by default please enable it for testing in config.ini (allow_upload_media = true)
  • Size of the files can be limited using media_max_size, please set media_max_size in config.ini before running. Its unit is megabyte, for example 10 megabytes:
media_max_size = 10 
  • The uploaded media can be shared using markdown for example:
![picture](/media/<author>/<post_name>/<uuid>.png
or
![ducument](/media/<author>/<post_name>/<uuid>.pdf
  • Uploading media files is possible in Edit Post Metadata section. (edit the post-> edit post metadata or here: http://<example.com>/<author_name>/<post_name>/edit/meta), also the list of uploaded files is there.
  • The front-end part needs more improvements.
  • Total space can be limited using total_media_space, its unit is megabyte(s).

  • [x] I have signed the CLA

alborzjafari avatar Jul 29 '23 21:07 alborzjafari

This is such a huge feature. Can we expedite reviewing this and getting this merged?

sssilver avatar Aug 18 '23 21:08 sssilver

Could you please review this pull request?

alborzjafari avatar Aug 30 '23 19:08 alborzjafari

Thanks for submitting this. This is a pretty huge feature with many repercussions for the product, so this will need to be pretty solid before we can merge. I'll leave comments in the code as well, but here are some important things that need to be addressed:

  • Media metadata should probably be stored in the database, to help with management and permissions. Note that we've done a ton of work on this with our Write.as instance and Snap.as (using this table schema), and we could build on this if you want to collaborate on this instead of writing from scratch.
  • We'll need accompanying documentation in https://github.com/writefreely/documentation to ensure people configure any reverse proxy to also allow large file uploads (e.g. most servers are configured for <10MB by default)
  • Please run go fmt on all files, per the Code Guidelines

Again if you'd like to work on this together, another way forward would be for you to work only on the UI for this -- uploading images and managing them -- and then I could contribute the backend work that we've already put in. Either way, let me know what you'd like to do.

thebaer avatar Sep 08 '23 15:09 thebaer

  1. "Media metadata should probably be stored in the database, to help with management and permissions." : I tried to to do something like inheriting permissions of a post for its files.
  2. "...another way forward would be for you to work only on the UI for this -- uploading images and managing them...": Would you address me in source codes, I didn't see about uploading images. My purpose is uploading all kind of files not only the images.

alborzjafari avatar Sep 10 '23 06:09 alborzjafari

Any news on this? My users keep bugging me that they want this :)

Cheers, y'all!

antranigv avatar Feb 20 '24 00:02 antranigv

Any news on this? My users keep bugging me that they want this :)

Cheers, y'all!

I too would like to get a status update about this

uniquePWD avatar May 30 '24 05:05 uniquePWD