Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

php script upload file error

Featured Replies

hello again any chance you can point me in the right direction with this script

 

<?php

if($_POST[upload] == "1")

{

$to = "uploads/".$_FILES['file']['name'];

move_uploaded_file($_FILES['file']['tmp_name'], $to);

echo "uploaded";

}

 

?>

 

 

<form method = "post" enctype="multipart/form-data">

<input name="upload" type="hidden" value="1" >

<input name="file" type="file" >

<input name="button" type="submit" value = "upload">

</form>

 

when i try it on my testing server i get the following

 

Warning: move_uploaded_file(uploads/index.php) [function.move-uploaded-file]: failed to open stream: No such file or directory in C:\wamp\www\test.php on line 5

 

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\wamp\tmp\phpD3.tmp' to 'uploads/index.php' in C:\wamp\www\test.php on line 5

uploaded

 

so i guess i have to create a file in my www directry called ?

 

but if it was live on my site would it have to have a file extension #am a bit confused it doesnt take much these days

 

thanks

  • Author

i have got it to work there i had put a spelling mistake in the file name on my www directory, now i have this working how do i use it to put a jpg to my server thanks

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.