Jump to content

Search the Community

Showing results for tags 'rename'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








Donation Link

Found 5 results

  1. I need to modify the script to additionally do the following: Once the image is on the server, I want it to duplicate itself, then, rename the new duplicated file to a variable name. (Let's say $TEST . '.jpg' where $TEST = TESTING for this example) My current piece of code: This following piece of code might assist you: PS: I am quite new to PHP. (Introduced to it only about 3 days ago)
  2. ~Sorry for topic title, didn't know what to call it.~ Basically, What I want to do is have an image uploader that renames the file to the user's username. For example: If Jeff went to upload his image and on his computer it was called '38483_fbkn.PNG' I want it to rename the file too 'Jeff.jpg' I've done this before but I honestly for the life of me can't remember how I did it. Any help? Also sorry if wrong section, I'm new here
  3. I am trying to store images in a folder on server. For some reason the images that need to be uploaded should be with their orignal name as uploaded by user i.e they can be changed only wth the original name in it. 1)So how can i put it in folder using php and retrieve it wherever needed whch means the name should be in database. 2)Now in the folder if two files with the same name are uploaded then the latest would overwrite whch should be avoided. Plz could anyone give some way to make ths up.
  4. so I'm in the process of making a .gif uploading website, and this is my code for "upload_file.php". <?php $allowedExts = array("jpg", "jpeg", "gif", "png"); $extension = end(explode(".", $_FILES["file"]["name"])); if ((($_FILES["file"]["type"] == "image/gif")) && ($_FILES["file"]["size"] < 5242880) && in_array($extension, $allowedExts)) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br>"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br>"; echo "Type: " . $_FILES["file"]["type"] . "<br>"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " kB<br>"; echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br>"; if (file_exists("i/" . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; } else { move_uploaded_file($_FILES["file"]["tmp_name"], "i/" . $_FILES["file"]["name"]); echo "Stored in: " . "i/" . $_FILES["file"]["name"]; } } } else { echo "Invalid file"; } ?> How can I add a random image name? Preferably 6-8 digits of only #0-9. That way the image name is simple instead of being specific to capital letters etc. Please be as specific with directions as possible, because I'm still learning PHP, and that's one of the main reasons I'm making this website. P.S. Bonus points if you can tell me how to redirect straight to the image without the page that shows the file info.
  5. Hi everybody ! I have a big problem with my images on my FTP... A friend has uploaded thousands of images with a "+" character in the filename on our FTP. For some reasons, my CMS doesn't support it and I need to change the "+" character by a "_" character, directly on the FTP cause it will rake too much time to download all the images and upload them again. So I need a script (PHP ?) that will go in the right subdirectory and replace the "+" if it exists by the "_" character. Someone could help me ? Thanks, Cedric
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.