Results 1 to 6 of 6

Thread: Upload image uniq name

  1. #1

    Default Upload image uniq name

    Hi,
    when you upload image with name image.jpg and then the new item has the same name (image.jpg) the first one gets overridden.

    Can someone point some solution for uniq names...so if the image has the same name it gets the item ID, just like alias issue

    Best regards,
    W.
    Web design agency - EDsolution.si Izdelava spletnih strani

  2. #2
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default Re: Upload image uniq name

    Hey wotanskrieg,
    I don't think that makes sense logically, otherwise how would you ever overwrite an image if you wanted too?
    I think solutions if you absolutely needed this would be:

    Frontend - to either find an existing uploader that allows this (which I would doubt exists for the above reason) and use it instead of the system one, or write your own upload script.

    Backend - make use of the "postUpload" hook to intercept, compare and change the filename.

  3. #3

    Default Re: Upload image uniq name

    Yeah you have a point, but if you have member who upload image 1.jpg and than the other member upload the image 1.jpg...well the first members image will be overridden.
    Web design agency - EDsolution.si Izdelava spletnih strani

  4. #4
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default Re: Upload image uniq name

    If you mean frontend, you can assign each member their own directory.

  5. #5

    Default Re: Upload image uniq name

    That would be a great solution, but we are talking about Catalog here. But ok this is a good start since the new folder has the user ID, now it only needs to be uploded to this folder.
    Web design agency - EDsolution.si Izdelava spletnih strani

  6. #6

    Default Re: Upload image uniq name

    Ok I've figure it out.

    In the ModuleCatalogEdit.php i've change path of file to members/user_ '.' $userid, so it isn't even necessary to assign each member their own directory because when they upload image the folder is created itself in a way user_25.

    Thanks for the tip ramjet
    Web design agency - EDsolution.si Izdelava spletnih strani

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •