lional Posted August 26, 2008 Share Posted August 26, 2008 Hi All I am busy with a script that uploads a file to the webserver and then sends the file as an attachment. After I have mailed it I would like to delete the file from the directory on the webserver. Is this poissible with PHP Thanks Lional Link to comment https://forums.phpfreaks.com/topic/121397-deleting-files-from-directories/ Share on other sites More sharing options...
r-it Posted August 26, 2008 Share Posted August 26, 2008 the php function is called unlink Link to comment https://forums.phpfreaks.com/topic/121397-deleting-files-from-directories/#findComment-625936 Share on other sites More sharing options...
Fadion Posted August 26, 2008 Share Posted August 26, 2008 Just to explain a bit more what r-it said: <?php $file = 'somefile.doc'; unlink($file); ?> Link to comment https://forums.phpfreaks.com/topic/121397-deleting-files-from-directories/#findComment-625938 Share on other sites More sharing options...
lional Posted August 26, 2008 Author Share Posted August 26, 2008 Thanks One more thing. If I upload a file using move_uploaded_file it works fine if the file is about 500K but for larger files it reports the file size as 0 and won't upload the file Link to comment https://forums.phpfreaks.com/topic/121397-deleting-files-from-directories/#findComment-625946 Share on other sites More sharing options...
r-it Posted August 26, 2008 Share Posted August 26, 2008 are you on a dedicated or shared host, if it's the latter i can't help you as i have a similar problem myself otherwise you just have to set the max upload size in your php.ini file to the desired one. Link to comment https://forums.phpfreaks.com/topic/121397-deleting-files-from-directories/#findComment-625952 Share on other sites More sharing options...
Fadion Posted August 26, 2008 Share Posted August 26, 2008 Take a look at this section of the manual. Link to comment https://forums.phpfreaks.com/topic/121397-deleting-files-from-directories/#findComment-625955 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.