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 Quote Link to comment Share on other sites More sharing options...
r-it Posted August 26, 2008 Share Posted August 26, 2008 the php function is called unlink Quote Link to comment 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); ?> Quote Link to comment 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 Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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.