pankaj.ghadge Posted August 26, 2008 Share Posted August 26, 2008 I am uploading a file(Document file) using php & i don't know the file extension that is supported in both linux and windows.and if the file is not from these extension i need to delete the file from temp folder or not.so please tell me the extension or code ............ Link to comment Share on other sites More sharing options...
Lulzim Posted August 26, 2008 Share Posted August 26, 2008 What do you mean by 'supported file extensions' ?Operating system does not 'support' file extensions. You can give a file whatever extension you want (you can even have files without extensions or files without file name, just the extension (.htaccess) ) Whether you can open these files or not depends if you have installed a software that is able to open files. Some of these additional software comes with os for some files you will have to install additional software.Though on some operating systems there are some limitations on file extensions. The only one that I can think of right now is dos wouldn't allow extensions with more than 3 characters. As for windows and linux/unix I know you can't have some special characters on file names (\, / ...). Link to comment Share on other sites More sharing options...
pankaj.ghadge Posted August 26, 2008 Author Share Posted August 26, 2008 But how would i know that file is text file or not ......like we r doing it for images$_FILES["uploaded_file"]["type"] == "image/jpeg" . Link to comment Share on other sites More sharing options...
Lulzim Posted August 26, 2008 Share Posted August 26, 2008 if($_FILES["uploaded_file"]["type"] == "text/plain") { ..... } for other file types: http://www.duke.edu/websrv/file-extensions.html Link to comment Share on other sites More sharing options...
pankaj.ghadge Posted August 26, 2008 Author Share Posted August 26, 2008 if the file is not text file. i need to delete the file from temp folder or not. Link to comment Share on other sites More sharing options...
Lulzim Posted August 26, 2008 Share Posted August 26, 2008 if you don't move the file to another location, when the script execution is completed the file will be deleted from temp folderif it's not a allowed file type, don't move it and forget it Link to comment Share on other sites More sharing options...
pankaj.ghadge Posted August 26, 2008 Author Share Posted August 26, 2008 Thanks buddy bye............. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.