Folder View 2 Support Product Page

File Management

Shared 14 years ago
1
likes this idea
14 years ago Bart Garner posted:
If this had Delete functionality it would be perfect!


Edited by - Bart Garner on 05 Oct 2010  18:52:18

Replies

Replied 13 years ago
13 years ago manuel pinto replied:
If this has the functionality to link files and not only showing files and folders it's perfect.
Replied 12 years ago
12 years ago Graeme Beaty replied:
It is possible to delete a file using Folderview and one php file. From folder simply use the 'Go To URL' behaviour and send to a page where you will have the delete action + the name of the relevant file e.g. delete-file.php?filename={path}

On the processing page simply state the following

<?php
$filename=$_GET['filename'];
unlink ($filename);

$updateGoTo = "[i][b]THE PAGE YOU WISH TO REDIRECT TO AFTER THE DELETION[/i][/b]";
if (isset($_SERVER['QUERY_STRING'])) {
$updateGoTo .= (strpos($updateGoTo, '?')) ? "&" : "?";
$updateGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $updateGoTo));

?>

Hey presto!

Reply to this topic