If:
Then:
declare extern ErrMsg,ErrReturn,FileID,UName,NameEnc,OutShare
If:
Then:
declare UpReal,UpOrig,UpSize,UpDest,UpBase,RmBase,UpOwner,OUpPass,UpRestrict,Deleted
If:
Then:
declare OHandle(4,.0),Msg,IHandle(4,.0),SelfURL,Style,Pre,FPos(20,.0),FLine,ShareDir
If:
Then:
declare Cookie,CLUName,CLPass,OutFile(256,*)
If:
Then:
ErrReturn="NOT DONE"
If:
Then:
lookup downfl = flfss_uploads k=(FileID) i=b -npx
If:
not downfl
Then:
ErrMsg="File does not exist.";close downfl;end
If:
Then:
UpOrig=downfl(2);UpDest=downfl(3);UpSize=downfl(4);UpRestrict=downfl(8);Deleted=downfl(10)
If:
Then:
UpOwner=downfl(1);OUpPass=downfl(12)
If:
Deleted eq "Y"
Then:
close downfl;ErrMsg="File marked as deleted. File not made available for public sharing.";end
If:
UpRestrict eq "Y"
Then:
close downfl;ErrMsg="File is password restricted. File not made available for public sharing.";end
If:
Then:
IHandle=open("flfss.sharedir","r")
If:
IHandle lt "0"
Then:
ShareDir="/usr/fairlite/public_html/flfss_openshares";goto
onerd
If:
Then:
ln=readline(IHandle,ShareDir,"999")
If:
Then:
ln=close(Ihandle)
If:
Then:
IHandle=open("flfss.shareurl","r")
If:
IHandle lt "0"
Then:
OutShare="http://www2.onnik.com/~fairlite/flfss_openshares";goto
tword
If:
Then:
ln=readline(IHandle,OutShare,"999")
If:
Then:
ln=close(Ihandle)
If:
Then:
IHandle=open("flfss.styleurl","r")
If:
Then:
ln=readline(IHandle,Style,"999")
If:
Then:
ln=close(Ihandle)
If:
Then:
IHandle=open("flfss.baseurl","r")
If:
IHandle lt "0"
Then:
SelfURL="/~fairlite/cgi-bin/cgiwrap/filepro/onegate";goto
skiprd2
If:
Then:
ln=readline(IHandle,SelfURL,"999")
If:
Then:
ln=close(IHandle)
If:
Then:
IHandle=open(UpDest,"rb")
If:
IHandle lt "0"
Then:
ErrMsg="Could not open uploaded file.";end
If:
Then:
OutFile=ShareDir{"/"{NameEnc
If:
Then:
OutShare=OutShare{"/"{NameEnc
If:
Then:
OHandle=open(OutFile,"wc0b")
If:
OHandle lt "0"
Then:
ErrMsg="Could not open share output file."<OutFile;end
If:
Then:
ln=read(IHandle,FLine,"8192")
If:
FPos lt UpSize and ln eq "0"
Then:
ErrMsg="Premature end of file during copy.";end
If:
Then:
lo=write(OHandle,FLine)
If:
lo ne ln
Then:
ErrMsg="Could not write entire line to file during copy.";end
If:
Then:
ln=close(IHandle);ln=close(OHandle)
If:
Then:
sc="/bin/chmod 644"<OutFile
If:
Then:
ErrMsg="Created Public URL: "{OutShare