Welcome Guest, Not a member yet? Register   Sign In
Eliminate uploaded files
#1

[eluser]Franklin2988[/eluser]
Hi everybody.

I have uploaded files using the upload class to a folder. Just great.

My question is that I need to eliminate the files,documents,that I have uploaded. I really do not know how to do it, so I ask for your help.

It is no t to eliminate the name of the file,document, it is to eliminate the complety file from the folder.

Than you very much for your help.
#2

[eluser]nuwanda[/eluser]
When php uploads a file, the file is put in a temp dir on the server, but only for the duration of that script.

When the script ends, the file is deleted. You don't have to do it manually. That's why your script works on the file and saves it somewhere else.
#3

[eluser]Franklin2988[/eluser]
Thank you for the answer but I still dont get it, so I am going to explain what I am doing
I am developing an application for a lawyer, so he needs to manage files, he uploads files in order to use them we he needs it, so I upload the file in a folder using the CI class and then save the name of the file in database. I can retrieve all the files the lawyer has uploaded but the question is, How do I eliminate the file, for example if the lawyer no longer needs a file, I can eliminate the data form the database but that dont eliminate the file in the folder, and I want to do it automatically, another options is to save in a table the information of the files the lawyer has eliminated, doing that to later on the administrator eliminates manually the files but it is not the best option.

So if anybody can help me I will really appreciate it.
#4

[eluser]dudeami0[/eluser]
PHP unlink

Quote:Description
bool unlink ( string $filename [, resource $context ] )

Deletes filename. Similar to the Unix C unlink() function. A E_WARNING level error will be generated on failure.
#5

[eluser]InsiteFX[/eluser]
You can also read this in the User Guide.

User Guide File_Helper

InsiteFX
#6

[eluser]Franklin2988[/eluser]
[quote author="dudeami0" date="1290615338"]PHP unlink

Quote:Description
bool unlink ( string $filename [, resource $context ] )

Deletes filename. Similar to the Unix C unlink() function. A E_WARNING level error will be generated on failure.
[/quote]

Thank you very much for your help, I used unlink function and it worked :)




Theme © iAndrew 2016 - Forum software by © MyBB