Welcome, Guest
Username: Password: Remember me

TOPIC: Advert image upload - Original files not deleted

Advert image upload - Original files not deleted 2 years 9 months ago #1835

  • Mikkel Olsen
  • Mikkel Olsen's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 6
  • Thank you received: 1
  • Karma: 0
Hi,

When a user creates an advert and uploads images, I see that the images are correctly saved in different sizes, which is good, but I see that the original image files are also stored on the server. This is not good because this takes up unnecessary server space.

Here is an example:

A user creates an advert and uploads an image files "image-file.jpg"
When the advert is created the image is stored like this:

/media/com_jomclassifieds/adverts/(advert-ID)/image-file.jpg
/media/com_jomclassifieds/adverts/(advert-ID)/image-file_gallery.jpg
/media/com_jomclassifieds/adverts/(advert-ID)/image-file_grid.jpg
/media/com_jomclassifieds/adverts/(advert-ID)/image-file_list.jpg
/media/com_jomclassifieds/adverts/(advert-ID)/image-file_popup.jpg

Often the original file is very large, maybe more than 1MB, and if the system does not use this file why is it stored on the server?
In this case the file "image-file.jpg" should be deleted.

Please look into this.

Best regards
Mikkel
The administrator has disabled public write access.

Advert image upload - Original files not deleted 2 years 9 months ago #1842

  • Super User
  • Super User's Avatar
  • Online
  • Administrator
  • Posts: 2759
  • Thank you received: 292
  • Karma: 40
Hi,

Kindly check the below forum thread link for this issue.

jomclassifieds.com/forum/general-discuss...ges-from-server.html

If still you have issues, kindly let me know.

Thanks.
The administrator has disabled public write access.

Advert image upload - Original files not deleted 2 years 9 months ago #1890

  • Mikkel Olsen
  • Mikkel Olsen's Avatar
  • Offline
  • Fresh Boarder
  • Posts: 6
  • Thank you received: 1
  • Karma: 0
Thanks you for the answer.
The link you gave me is regarding a slightly different problem which is fine, now that is sorted :)

There is still a problem when you create a new advert or if you edit an advert and add new images.
So the problem remains, that the original image file is stored on the server whenever you create an advert, or if you add images to an existing advert.

As far as I can tell the PHP file that handles the image uploads is this file:
/administrator/components/com_jomclassifieds/etc/uploader.php

All I need to know is how to change this script to automatically unlink the original image file after it has been resized.
The administrator has disabled public write access.

Advert image upload - Original files not deleted 2 years 9 months ago #1903

  • Super User
  • Super User's Avatar
  • Online
  • Administrator
  • Posts: 2759
  • Thank you received: 292
  • Karma: 40
Dear Customer,

We don't know which version of Jom Classifieds you are using. So kindly mail (This email address is being protected from spambots. You need JavaScript enabled to view it.) the uploader.php from the below path,'

/administrator/components/com_jomclassifieds/etc/uploader.php

So that we can add the code snippet to unlink the original file and update you.

Thanks.
The administrator has disabled public write access.
Time to create page: 0.211 seconds