I dont want full size image be saved

in default File plugin , if we upload image , full size image will be saved and then thumbnails (large,medium,small) created

the problem is i dont want to save full size image , because it's useless for my site (my site only use the large, medium,small thumbnail), and it will use so many space in storage

how to not save full size image?

 

  • The files plugin is not only for image files but for other types of files, too. The original uploaded file is kept to be available for download (surely wanted with any non-image file type). The thumbnails for image files is to some extend a bonus to display the images already on-site. Still the original image files are supposed to be available for download, too.

    If you don't want to keep the original image files some heavy re-writing of the files plugin code would become necessary to dffer between image type files and others, offer downloads of the original file not for images etc. I can't tell you every step necessary. I can only tell you that it is not as trivial as you might think. Maybe you want to even create a separate plugin to allow for uploads of images only (especially if you aim at offering image uploads exclusively). The plugin could be based on the files plugin without the hassle to differ between image file types and others. Still a lot of rewrite work would be necessary.

  •  i have modified File plugin to only can save image file only . If user upload non-image it return error message.  I have removed download button too . Full size image is really useless for my site , just eat my hosting storage.

    maybe the solution is delete original file after thumbnail created

    Can i use unlink() ?