Chikwado Posted March 15, 2015 Share Posted March 15, 2015 Some one check this: http://www.w3schools.com/php/php_file_upload.asp this php tutorial is it suppoted to html and php document, because I have read the tutorial and it seem to base on image upload. Some one help. Link to comment Share on other sites More sharing options...
Ingolme Posted March 15, 2015 Share Posted March 15, 2015 If you understand what the script is doing, then you will know which part to change so that it will work for files other than images. This line is the one that checks if the file is an image: $check = getimagesize($_FILES["fileToUpload"]["tmp_name"]); From the PHP manual: http://ca1.php.net/getimagesize Link to comment Share on other sites More sharing options...
Chikwado Posted March 16, 2015 Author Share Posted March 16, 2015 (edited) Ok, Is it possible to do it like this: $check=getimagesize($_FILES ['fileToUpload']['tmp_name']);//To add html and php document $check=getphpsize($_FILES ['fileToUpload']['tmp_name']); Edited March 16, 2015 by Chikwado Link to comment Share on other sites More sharing options...
justsomeguy Posted March 16, 2015 Share Posted March 16, 2015 PHP does not have a function called getphpsize. Link to comment Share on other sites More sharing options...
Chikwado Posted March 16, 2015 Author Share Posted March 16, 2015 (edited) Ok, how do you add a line that would check html and php document. Edited March 21, 2015 by Chikwado Link to comment Share on other sites More sharing options...
justsomeguy Posted March 16, 2015 Share Posted March 16, 2015 If you want to check what kind of file it is then it's just to check the file extension. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now