Jump to content


Photo

unlink from server problem ?


  • Please log in to reply
7 replies to this topic

#1 ParK

ParK
  • New Members
  • Pip
  • Newbie
  • 5 posts
  • Locationistanbul/turkey

Posted 10 September 2006 - 07:49 PM

this is my delete.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);
?>


not working :(

any suggestion or help ?


#2 HuggieBear

HuggieBear
  • Members
  • PipPipPip
  • Advanced Member
  • 1,899 posts
  • LocationEngland, UK

Posted 10 September 2006 - 08:12 PM

What are you trying to do, open the file and then delete it?

Regards
Rich
Advice to MySQL users: Get phpMyAdmin and test your queries work there first, take half the hassle out of diagnosis, also check the reserved words list.

Links: PHP Docs :: RegEx's :: MySQL :: DevGuru :: w3schools

#3 °°Ben³

°°Ben³
  • Members
  • PipPip
  • Member
  • 17 posts
  • LocationGermany / Remagen

Posted 10 September 2006 - 10:42 PM

Remove the @ and hope that an error message is put out.  ;D
desktop and web development ;)
---
English is not my native language. Please excuse if I made some errors in expression.

#4 JayBachatero

JayBachatero
  • Members
  • PipPipPip
  • Advanced Member
  • 296 posts
  • LocationQueens NY

Posted 11 September 2006 - 12:08 AM

You don't need to delete the tmp file after you upload the file.  Also the tmp file is stored in the tmp dir.
JayBachatero
SMF Developer && Converter Specialist

#5 ParK

ParK
  • New Members
  • Pip
  • Newbie
  • 5 posts
  • Locationistanbul/turkey

Posted 11 September 2006 - 05:04 AM

i want to delete it ... @ should be in there ....

i cant delete any files ?

thats my upload.php name > uploadedfile

and changed delete.php to >
@unlink( '../il-uploads/'.$uploadedfile,'r');

it doesnt delete ...

upload somthng  and try to delete it

you cant delete the file which you have uploaded

#6 ParK

ParK
  • New Members
  • Pip
  • Newbie
  • 5 posts
  • Locationistanbul/turkey

Posted 11 September 2006 - 10:00 AM

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 ?

thanx :)

#7 Jenk

Jenk
  • Members
  • PipPipPip
  • Advanced Member
  • 778 posts

Posted 11 September 2006 - 11:27 AM

remove the @. It is hiding the one thing that will be most useful to you right now.. so remove it.

#8 JayBachatero

JayBachatero
  • Members
  • PipPipPip
  • Advanced Member
  • 296 posts
  • LocationQueens NY

Posted 11 September 2006 - 08:11 PM

Ok you going to have to explain a lil better exactly what you are trying to do.  From the look of it I see that you are uploading a file and deleting it right after you upload it.  Not sure what is the whole point in doing this.
JayBachatero
SMF Developer && Converter Specialist




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users