how to overwrite upload image file (with same name but with diff extension)?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sidhx
    New Member
    • Dec 2009
    • 50

    how to overwrite upload image file (with same name but with diff extension)?

    how can i let image overwriting when uploading? and if uploading an image say "logo.jpg" and if a file already existing say "logo.png" then, how can i replace the file logo.png to logo.jpg(which has same name but different extension)?

    Ex: I want replace logo.jpg with logo.png or any image extension file.

    In my code while uploading the image i rename the upload image name to "logo" and add extension it had been provided.
  • johny10151981
    Top Contributor
    • Jan 2010
    • 1059

    #2
    if the extension is different then you do not need to over write.

    Comment

    • sidhx
      New Member
      • Dec 2009
      • 50

      #3
      hi johny assume that i have to upload screen-shot which may contain jpg or png file format only one screen-shoot is available to upload.First i upload file name pic.jpg my code stores it in the from of screen1.jpg now i think that image is wrong( or i want replace it) so i upload with another image say animate.png. Now my code should replace the screen1.jpg (i.e pic.jpg as uploaded name) with screen1.png (which is animate.png as uploaded name )this way i got 4 screen uploading type which should work similarly
      i can do it with same extension.How to do it for different extension and diff screen shot(like screenshoot1,sc reenshoot2,scre enshoot3,screen shoot4) in the same folder.

      Comment

      Working...