473,394 Members | 1,769 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

How to delete a file on apache using PHP?


Hi everybody,

I'm trying to remove a file when an upload is complete. Now, if the
file doesn't meet some requriements then must get deleted.

1) The problem is that I'm getting an error as:

PHP Fatal error: Call to undefined function ulink() in /var/www/html/
app/upload.php on line 42
if (!ulink($uploaded_file)) //this line 42 <====
{
error_log("Notice: Couldn't delete file ". $uploaded_file, 0, "/
var/www/html/.../report.log");
}
else
{
error_log("Info: Suspicious file ". $uploaded_file . " removed by
the system.",
}

Thanks.
Mar 25 '08 #1
1 1577
On Mar 25, 2:59*pm, amit <amit.ko...@gmail.comwrote:
Hi everybody,

I'm trying to remove a file when an upload is complete. Now, if the
file doesn't meet some requriements then must get deleted.

1) The problem is that I'm getting an error as:

PHP Fatal error: *Call to undefined function ulink() in /var/www/html/
app/upload.php on line 42

if (!ulink($uploaded_file)) * //this line 42 * <====
{
* * error_log("Notice: Couldn't delete file ". $uploaded_file, 0, "/
var/www/html/.../report.log");}

else
{
* *error_log("Info: Suspicious file ". $uploaded_file . " removed by
the system.",

}

Thanks.


I cann't believe I had a typo !!!

Mar 25 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Phil Powell | last post by:
print_r(is_file("$logPath/$logFileName")); // RETURNS 1 unlink("$logPath/$logFileName"); // RETURNS WARNING: PERMISSION DENIED This code should tell me that the file located at...
2
by: Mike | last post by:
I am sure that I am making a simple boneheaded mistake and I would appreciate your help in spotting in. I have just installed apache_2.0.53-win32-x86-no_ssl.exe php-5.0.3-Win32.zip...
0
by: Jagdeesh | last post by:
Hai Colleagues, I am using Tomcat 4.1.24 and JDK 1.4.0_03 in my winXP machine. I've transferred a set of folders(containing jsp files) into tomcat's webapps directory(to /webapps/bob ,...
11
by: comp.lang.php | last post by:
Once again, I thought my class method deleteZip() would do the trick, but it never deletes any .zip* file found in a directory: /** * Delete any latent ZIP files found in this album. This...
9
by: John C. Frickson | last post by:
My company produces reports for our customers in PDF format. I have a php script that verifies login status and access rights, and sends the pdf to the client using readfile(). This has worked...
30
by: Adam Baker | last post by:
Hello, I'm writing a site where a handful of people will be able to edit the content using PHP scripts (FCKeditor). The content is stored as individual files in a directory. I'd like to validate...
1
by: rohitkec | last post by:
I am new to both java andb apache tomcat.i am presently using apache tomcat 4.1.31 & j2re-1_4_2_10.when i am running http://127.0.0.1:8080/admin/login.jsp or admin file i am getting the following...
7
madhoriya22
by: madhoriya22 | last post by:
Hi, I am trying to read a file sent from client to server. Here is how I am trying it .... String filePath = request.getParameter("SelectCSVFile"); System.out.println("path:::---> "+filePath);...
0
rsrinivasan
by: rsrinivasan | last post by:
Hi all, I already posted the same question in this forum. But i did not get any solution for this. I am using tomcat4.1. This is my tomcat context configuration in server.xml file. ...
4
by: Damodhar | last post by:
hi any one help me to .. fix this problem I am using Windows Xp using Xamp to run my php application while unlink the file i received one error like Access denied in my local machine how can...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.