ambo Posted November 26, 2008 Share Posted November 26, 2008 Im haveing difficulty uploading PDFs as far as i can see there is no restrictions to file extensions <? $target_path = "../schedules/"; $target_path = $target_path . basename( $_FILES['uploadedfile']['name']); if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded <meta http-equiv=\"refresh\" content=\"2;url=admin.php\"/>"; } else{ echo "There was an error uploading the file, please try again! <meta http-equiv=\"refresh\" content=\"2;url=admin.php\" />"; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/134408-solved-file-upload/ Share on other sites More sharing options...
akitchin Posted November 26, 2008 Share Posted November 26, 2008 you're going to have to give us more than that. what problem, specifically, are you having? will the form not submit? do you receive an error message? does it just show up blank? does it say it worked, but the file doesn't appear in the folder? Quote Link to comment https://forums.phpfreaks.com/topic/134408-solved-file-upload/#findComment-699728 Share on other sites More sharing options...
ambo Posted November 26, 2008 Author Share Posted November 26, 2008 When i choose a pdf and submit it says there was an error uploading which was the error message in the code but when i upload a jpeg the jpeg works fine Quote Link to comment https://forums.phpfreaks.com/topic/134408-solved-file-upload/#findComment-699730 Share on other sites More sharing options...
Stryves Posted November 26, 2008 Share Posted November 26, 2008 Are you sure there isn't more code than that? A lot of upload scripts check file extensions to determine if it's a valid image or not. Quote Link to comment https://forums.phpfreaks.com/topic/134408-solved-file-upload/#findComment-699737 Share on other sites More sharing options...
akitchin Posted November 26, 2008 Share Posted November 26, 2008 my guess is that there's a filesize issue. is that the entire code? what does the HTML form look like? Quote Link to comment https://forums.phpfreaks.com/topic/134408-solved-file-upload/#findComment-699738 Share on other sites More sharing options...
ambo Posted November 27, 2008 Author Share Posted November 27, 2008 Good call LoL problem with the form <input type="hidden" name="MAX_FILE_SIZE" value="100000" /> Quote Link to comment https://forums.phpfreaks.com/topic/134408-solved-file-upload/#findComment-700377 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.