Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Prevent image overwrite on product upload.


XxWickedxX

Recommended Posts

I've been on this for hours with no avail. A couple reasons preventing product images directory from being able to overwrite another file is as follows if its possible to do.

 

*Multiple Admins uploading product images end up eventually overwriting another persons images.

 

*A store with a high product volume becomes a higher risk at every upload of possibly overwriting an older product image by using the same file name when uploading.

 

It seems a like a check could be added to prevent or flag an error before overwriting an existing image when uploading product images. I have already thought of permission changes as a first thought. Its not feasible because lowering perms below 644 causes a failure to render on the catalog for obvious reasons so its not that simple.

 

Alternatively, if such a check can not be made I foresee a couple less than equal equivalents.

 

A.) The file names could be uploaded automatically by being auto titled with something such as a date format preventing replication. (would work but probably not favored)

 

B.) A more equal option would be to utilize some of the features the Contribution Download File Helper utilizes. This contrib as one feature it has is a check button that will check the download directory for a desired filename and reflect either a red or green fill color to acknowledge if a file with that name exist or not. Someone above my minor manipulation knowledge could use that feature from that mod and make place check buttons beside the browse buttons for the image directory instead. I tried to do this with no luck (Limited understanding).

 

C.) Using the PHP IF FILE EXIST Function connected with a call to the text field of an entered value upon activating the submit process. I almost knew how to pull this off but do not know how to make the file name in the FILE EXIST FUNCTION to reflect a form submitted value rather than a hard coded input.

 

I would be very interested to see this concept get picked up by someone with the know how. I feel its a needed feature since overwriting past product image files can be achieved accidentally so easily. I welcome any comments from those who would be interested in such a feature as well.

Edited by XxWickedxX
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...