O'Reilly Forums: Possible Problem - O'Reilly Forums

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Possible Problem Uploading any file possible.

#1 User is offline   Bryan22 

  • New Member
  • Pip
  • Group: Members
  • Posts: 2
  • Joined: 20-August 12

Posted 20 August 2012 - 03:45 PM

I may have found a problem with example 20-9 rnprofile.php.
While playing around with the site i realized one picture wouldn't re-size correctly. After further investigation I found the file was of type .bmp but it still was still uploaded to the site. Then I tried with a text file and had similar results. Files ended up in .jpg format on the site. Solved the problem by moving the "move_uploaded_file($_FILES['image']['tmp_name'], $saveto);" line of code into each of the acceptable cases, that way the file wouldn't be copied into my website's directory unless it was of acceptable type, this solved the re-size problem as well since no file will be uploaded that would make $typeok false.

Hope that makes sense and helps someone running into the same problem.

Bryan.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users