Automatic decompress uploaded zip files
Posted: Sun Jan 03, 2010 2:22 pm
-- Description: Automatic decompress uploaded zip files
-- You should add the below scripts to the event manager -> FTP or HTTP OnFileUploaded
-- And I suppose you have installed WinRAR in the directory "C:\Program Files\WinRAR"
-- Author: Luke
-- Date: 2010-01-01
-- You should add the below scripts to the event manager -> FTP or HTTP OnFileUploaded
-- And I suppose you have installed WinRAR in the directory "C:\Program Files\WinRAR"
-- Author: Luke
-- Date: 2010-01-01
Code: Select all
local fname = string.gsub("%PathName", "\\","/")
local dpath = string.sub(fname,0,string.len(fname)-4)
local ext = string.lower(string.sub(fname,-4))
if ext == ".rar" or ext == ".zip" or ext == ".tgz" then
os.execute("C:\\Progra~1\\WinRAR\\WinRAR x -Y \""..fname.."\" \""..dpath.."\\\" ")
end