Jump to content

Search the Community

Showing results for tags 'move_uploaded_file'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • 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

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. I have a script that uploads files fine on my local server running MAMP but when I upload it I get no file upload. I have tried to simplify as much as possible to troubleshoot and came up with the following script: <?php ini_set('display_errors', 1); error_reporting(E_ALL); define('BASE_DIR', '/home/lineligh/public_html/Art3/'); define('IMG_UPLOAD_DIR',BASE_DIR.'artwork/'); $id='4'; print_r($_FILES); if (isset($_FILES['picture']['name'])) { //check size if ($_FILES['picture']['size'] > 900000) { $uploaderr = true; $uploaderrmsg.='File must be less than 900,000 bytes<br />'; } //check type if ($_FILES['picture']['type'] != "image/jpeg" && $_FILES['picture']['type'] != "image/png") { $uploaderr = true; $uploaderrmsg.='File must be a jpeg or png<br />'; } $uploaddir = IMG_UPLOAD_DIR; $uploadfile = $uploaddir . $id . '.' . end((explode(".", $_FILES["picture"]["name"]))); $result = move_uploaded_file($_FILES['picture']['tmp_name'], $uploadfile); echo '<br>'.$_FILES['picture']['tmp_name']."</br>"; echo $uploadfile; echo '<br>$result: '.$result; } ?> Which produces the following output: Array ( [picture] => Array ( [name] => Olivia-IMG_8678.jpg [type] => image/jpeg [tmp_name] => /tmp/phpe5Vpyq [error] => 0 [size] => 192649 ) ) /tmp/phpe5Vpyq /home/lineligh/public_html/Art3/artwork/4.jpg $result: 1 So, the file gets to the server, the move_uploaded_file function claims that it successfully renames the file and puts it in /home/lineligh/public_html/Art3/artwork/ but if I look for the file it is not there. I'm stumped as to what else to check. Webhosting company swears that my permissions are correct.
×
×
  • 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.