[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [ic] File Manager


Davor Ocelic suppressed wrote:
> I am working on building a "file manager" within Interchange for
> non-admin users.  I am stuck trying to set up a way to "delete" files.
> I have a simple tag that I can't seem to make work, and I get nothing in
> the error log. 
> 
> Here is the tag:
> 
> -------------------------------
> UserTag delete-file Routine <<EOR
> sub {
> 
> my ($row) = @_;
> my $file = $row->{deletefile};
>  unlink($file);
> 
> }
> EOR
> -----------------------------
> 
You have not declared any arguments for your UserTag:

    UserTag delete_file Order name
    UserTag delete_file Routine <<EOR
    sub{
        my $file = shift;
        unlink($file) or die qq{Cannot delete "$file": $!};
    }
    EOR

I didn't add your "$row->{deletefile}" code as I have no idea where
you're getting your $row hashref from, or how you intend to pass it
into the UserTag.

the above can be called as [delete-file name="relative/path/to/file"]

Paths should be relative from your catalog home - not absolute from the
filesystem root.

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    suppressed
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/

_______________________________________________
interchange-users mailing list
suppressed
http://www.icdevgroup.org/mailman/listinfo/interchange-users


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.