Warning: file(1337day.txt) [function.file]: failed to open stream: No such file or directory in E:\AppServ\www\fileupload\test\upload.php on line 14
The file doesn't exist OR more probable, you haven't put the right filepath/details for the file.
I'd use:
$fileinfo = pathinfo($file);
$file_ext = $fileinfo['extension'];
Also from what I can see, you haven't moved it to your uploads folder. The file only exists temporarily. If you don't want to upload the file to a folder, I think you can use a reference to the temp file itself.
Warning: imagecreate() [function.imagecreate]: Invalid image dimensions in E:\AppServ\www\fileupload\test\upload.php on line 20
I can't see $file_size referenced anywhere before line 19
Warning: imagecolorallocate(): supplied argument is not a valid Image resource in E:\AppServ\www\fileupload\test\upload.php on line 21
Errors following mostly to do with $image - which can't be an image if it's not created properly due to preceding error.
diafol
Keep Smiling
10,662 posts since Oct 2006
Reputation Points: 1,628
Solved Threads: 1,513
Skill Endorsements: 57
What u mean by reference to temp file itself
Modify this code and add this referance for me please.
No. As a programmer, that's your job. I'll give you an example:
<?php
if(isset($_FILES['file'])){
$file = $_FILES['file']['tmp_name'];
echo file_get_contents($file);
}
?>
<form method="post" enctype="multipart/form-data">
<input type="file" name="file" />
<input type="submit" value="go" />
</form>
Reference the tmp_file NOT the file itself
diafol
Keep Smiling
10,662 posts since Oct 2006
Reputation Points: 1,628
Solved Threads: 1,513
Skill Endorsements: 57
Question Answered as of 10 Months Ago by
diafol
and
pursefocus