473,465 Members | 1,677 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

unlink from server problem ?

ParK
4 New Member
[PHP]<?php
$doc_root=("../il-uploads/"); //main dir
$file=$_FILES['uploadedfile']['tmp_name'];
$fp = @fopen("../il-uploads/".$file,'r');//open it
@fclose($fp);
@unlink($doc_root.'/'.$file);
?>[/PHP]

not working :(

any suggestion or help ?

then changed to >

[PHP]@unlink( '../il-uploads/'.$uploadedfile,'r');[/PHP]

it doesnt delete ...
Sep 11 '06 #1
4 2193
ParK
4 New Member
[PHP]<?php
$doc_root=("../il-uploads/"); //main dir
$file=$_FILES['uploadedfile']['tmp_name'];
$fp = @fopen("../il-uploads/".$file,'r');//open it
@fclose($fp);
@unlink($doc_root.'/'.$file);
?>[/PHP]

not working :(

any suggestion or help ?

then changed to >

[PHP]@unlink( '../il-uploads/'.$uploadedfile,'r');[/PHP]

it doesnt delete ...
so how can i delete the uploaded by user i mean just user uploaded...

or

how can i write the line deleting the user uploaded file..."../il-uploads/'.$file_will_be_deleted.'";

what is the code $file_will_be_deleted equals user uploaded file ?

how can i delte a file which is just uploaded by user ?
Sep 11 '06 #2
ParK
4 New Member
yep anyone help ?
Sep 12 '06 #3
phpmaet
27 New Member
Hi,
you should use valid image path. this is corrent syntax.

unlink('$imagepath');

Thanks
Sep 13 '06 #4
ParK
4 New Member
Hi,
you should use valid image path. this is corrent syntax.

unlink('$imagepath');

Thanks
correct syntax ?

@unlink( '../il-uploads/'.$uploadedfile,'r');

or

@unlink( '$uploaddir'.$uploadedfile,'r');

same error ...
Sep 13 '06 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Eric | last post by:
Hello, I created a form to upload files. The formfield contents are stored as records in an Ascii file "data.dat"; for reasons I am not using a MySql database. The upoaded file itself is stored...
4
by: lawrence | last post by:
I wrote some code that let me upload a file to my server. Then I wrote some code to let me delete the file. But when I try to delete, I get this error: Warning: Unlink failed (Permission denied)...
10
by: lorenzogordon | last post by:
Hi there, I'd greatly appreciate any insights into the following problem: I've got PHP running fine on IIS (OS: Server 2003, SP1; IIS: 6.0; PHP: 4.3.11). In PHP, the user uploads a file,...
6
by: Benjamin | last post by:
Hello, I'm running PHP 5.2.0 as a Apache 2.2 server module. When, I try to unlink I get this: "Warning: unlink(file.txt) : Permission denied..." What and how do I change this so it works? Thanks
4
by: nitinpatel1117 | last post by:
Hi I am trying to delete a csv file using the unlink() function, but i keep getting a permission denied warning Warning: unlink(UsedNOS200704191.CSV): Permission denied in...
1
by: fcaserio | last post by:
Is there any PHP.INI config or windows permission (win 2003) that can prevent PHP to unlink files with the system path? unlink works with relative path: @unlink("temp\0000058.txt") but it is...
15
by: Morteneistrom | last post by:
Im a complete n00b at PHP so please forgive me if this i a stupid question Why wont the following work. PHP Code: <?php foreach (glob('../images/profil/*.jpg') as $filename) { echo...
11
by: byteoart | last post by:
I'm a newbie to php. I am trying to delete a file from the server that I put there (one file, not the whole directory). I am using unlink ($filename); I did the path as a relative path as...
18
by: Coffee Pot | last post by:
Thanks for any advice. ~ CP
4
by: kelvinwebdesigner | last post by:
Hi everybody! Im having trouble doing this task hope someone could help. I still working on my project/app where user can upload a file a server, that then provide him with the link that can be...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
1
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.