Re: Upload and Delete
by virtualsue (Vicar) on Mar 05, 2002 at 15:12 UTC
|
The Perl function unlink can be used to delete files. Use
of unlink will fail if your program doesn't
have the necessary authority over the file(s) to be deleted.
| [reply] [d/l] |
|
Ok, thanks, but unlik works in the machine that run the Perl CGI. The Perl CGI run in Unix Server.
| [reply] |
|
You should be able to use unlink on a PC,
so there must be something else wrong. Without knowing
anything about what you're doing, it's hard to say.
Are you using die with $! to show
you why the system couldn't perform the unlink? e.g.
unlink $file or die "Can't delete $file, $!"
If not, add that and see if it doesn't give you the help
you need. If you reply to this thread again, you'll save
a lot of time by explaining what you are doing in more
detail and including some relevant code.
| [reply] [d/l] |
Re: Upload and Delete
by earthboundmisfit (Chaplain) on Mar 05, 2002 at 15:07 UTC
|
Perhaps I don't understand the question, but I'm reading it that you want to delete a file that is stored on the same PC that the Perl script is running on. If this is the case, perlfunc->unlink is your friend. | [reply] |
(jeffa) Re: Upload and Delete
by jeffa (Bishop) on Mar 05, 2002 at 15:02 UTC
|
| [reply] |
Re: Upload and Delete
by steves (Curate) on Mar 05, 2002 at 14:51 UTC
|
There's no way to do this. Certainly not with the Perl CGI which is running on the server. And no client side language is going to provide access to the local file system unless there's some huge security hole.
Imagine for a minute that you could connect to web sites and have them delete your files. Ask yourself if you'd ever go to those sites.
| [reply] |
|
Just a few quick comments:
- I never saw a mention of CGI
in the context of his question
- Maybe the local file is on his PC, where the script is also running
I may well be off base here, but I think he would just like
to clean up his PC after the upload is complete.
| [reply] |
|
| [reply] |
|
I understand your words. But is for a local aplication not for a publish in a WWW.
Thanks.
| [reply] |