Error : failed to delete file cache for plugins

mastern

New Member
YetiShare User
Apr 24, 2013
56
1
0
Hi Adam,

I discover that removeFile function don't work for all plugins (imageviewer, mediaconverter) when using "Direct File Servers". So in Admin / file action : all process return a failed messages.

WHY ? Because plugins wasn't updated to work on a fileserver direct. (Even all screenshots for column view mode in "account_home" don't show up when usign "direct file server" with Mediaconverter for instanc )

HOW TO SOLVE IT ?
Need a call to the file Server Direct BUT not the Local as the files are not in local Server :
Code:
 $serverId = file::getDefaultLocalServerId();
IMAGEVIEWER CLASS : (Local Call)

Code:
 $serverId = file::getDefaultLocalServerId(); 
        if ($serverId)
        {
            // get all file listing
            $files = coreFunctions::getDirectoryListing($cacheFilePath);
            if (COUNT($files))
            {
                foreach ($files AS $file)
                {
                    fileAction::queueDeleteFile($serverId, $file, $fileId);
                }
            }

            // add folder aswell
            fileAction::queueDeleteFile($serverId, $cacheFilePath, $fileId);
			
			// remove any perm_cache
			fileAction::queueDeleteFile($serverId, $this->permCachePath . (int)$fileId . '/', $fileId);
        }
MediaConverter CLASS : (Local Call)

Code:
    public function deleteMediaCache($fileId)
    {
        // queue for delete
	$serverId = file::getDefaultLocalServerId();
        if ($serverId)
        {
            // queue cache for delete on local server
            $docRoot = fileServer::getDocRoot($serverId);
            $cacheFilePath = $docRoot . '/core/cache/plugins/mediaconverter/' . $fileId . '/original_thumb.jpg';
            fileAction::queueDeleteFile($serverId, $cacheFilePath, $fileId);
        }
    }
This work only for a local server not direct.

Regards,
 

enricodias4654

Member
YetiShare User
Jan 13, 2015
411
1
16
Many parts of the script were not made to work with direct file servers. I pointed some errors in other posts such as urls sent with the remote upload feature are always sent to the main server and not to the direct servers.
 

paypal1352

New Member
YetiShare User
Wurlie User
Mar 2, 2012
297
2
0
interesting, I haven't had any luck getting the media converter to work if the file was uploaded to a remote server or s3, this makes sense. Hopefully the plugins are updated along with v4.3