file name
[HTML]html
<html>
<head>
<title></title>
</head>
<body>
<form enctype="multipart/form-data" action="upload.php" method="POST">
Please choose a file: <input name="uploaded" type="file" /><br />
<input type="submit" value="Upload" />
</form>
</body>
</html>
[/HTML]
and my php file name upload.php
Expand|Select|Wrap|Line Numbers
- <?php
- $target = "http://example.com/up/";
- $target = $target . basename( $_FILES['uploaded']['name']) ;
- $ok=1;
- //This is our size condition
- if ($uploaded_size > 350000)
- {
- echo "Your file is too large.<br>";
- $ok=0;
- }
- //This is our limit file type condition
- if ($uploaded_type =="text/php")
- {
- echo "No PHP files<br>";
- $ok=0;
- }
- //Here we check that $ok was not set to 0 by an error
- if ($ok==0)
- {
- Echo "Sorry your file was not uploaded";
- }
- //If everything is ok we try to upload it
- else
- {
- if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
- {
- echo "The file ".
- basename( $_FILES['uploadedfile']['name']). " has been uploaded";
- }
- else
- {
- echo "Sorry, there was a problem uploading your file.";
- }
- }
- ?>
<link removed> is place where my script is located
and when run the script i am reciving thiss
Expand|Select|Wrap|Line Numbers
- Warning: move_uploaded_file(http://example.com/up/l1.php) [function.move-uploaded-file]: failed to open stream: HTTP wrapper does not support writeable connections. in /is/htdocs/wp1055726_DP59DMU8M7/www/upload.php on line 37
- Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move '/tmp/phpAKTFWT' to 'http://example.com/up/l1.php' in /is/htdocs/wp1055726_DP59DMU8M7/www/upload.php on line 37
- Sorry, there was a problem uploading your file.?>