Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8370421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:54:28+00:00 2026-06-09T13:54:28+00:00

Wherever I look on the difference between PHP functions’ rename and move_uploaded_file it always

  • 0

Wherever I look on the difference between PHP functions’ rename and move_uploaded_file it always says that the difference is that move_uploaded_file have some security features.

My questions are:

  1. what are those security features, what happen if I don’t use it?
  2. In case that I can’t use it (I did an upload but not through POST) so I have to use the rename function, what security measures do I need to take?

Thanks.

Edit
@Pekka asked from me to elaborate of how I plan to upload the file.
I’m going to upload files through Ajax, and I have some queue feature for uploading multiples files. Therefore I’m using the php://input stream.

If I understand Pekka answer correctly, I have nothing to worry about since I’m getting the file as a stream and I’m not copying any temp file.
Please correct me if I’m wrong.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T13:54:30+00:00Added an answer on June 9, 2026 at 1:54 pm

    The background of this was an ancient, pretty bad vulnerability (in the early 2000s) in which you, instead of uploading an actual file, you could overwrite the tmp_file path with a local file path, leading to that local file being treated as the upload instead of the real uploaded file. (There was no $_FILES array back then.)

    So for example, when uploading an avatar, the script would copy() the system file you specified (say, a configuration file ../../super_secret/config.php or a .htpasswd) to a public location and try to display it as the avatar image in a <img> tag.

    Strangely, I’m unable to find any specific info on this vulnerability (I’ve searched a number of times already over the past couple of years), but I know for a fact it existed because I tested it myself. Any links are welcome.

    As to what security measures to take, as said in the comment, I think you need to explain in more detail what kind of alternative file upload you are planning to use.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to call some functions whenever the mouse is moved wherever it
I've created a object that I'd like to have accessible from wherever the request-object
I have some image processing code that runs on a background thread and updates
I have a form created in Windows Forms which is draggable wherever I click.
I've got yet another deployment problem. What I have: little Windows Forms application that
Let's say I have two functions: void foo() { // A big function }
Having read some postings here about this topic, I realize that there are quite
Whenever I look at solutions to computer contests, I always see the term dynamic
Say I have a set of Sites that have a collection of Users .
Hi folks hi have a very interesting situation. i have a viewmodel that requires

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.