rejetto forum

Software => HFS ~ HTTP File Server => Bug reports => Topic started by: Mars on February 21, 2010, 10:08:03 PM

Title: [upload-name] bug
Post by: Mars on February 21, 2010, 10:08:03 PM
Modification already indicated several times

use the event with this formulation in hfs.events

Quote
[upload name]
rejetto-%item-name%

in upload results list, all file are renamed as 'rejetto-name.ext', BUT in the folder list you find the original name 'name.ext'.

Where is the bug ?

 ;D

Me, I know where. ;)

Quote
 // see if an event script wants to change the name
  s:=eventToFilename('upload name', []);
  if validFilepath(s) then // is it valid anyway?
    begin
    if pos('\', s) = 0 then  // it's just the file name, no path specified: must include the path of the current folder
      s:=f.resource+'\'+s;
    // ok, we'll use this new name
    data.uploadDest:=s;
    fn:=extractFileName(s);
   //from here, the new name is never assigned to data.f^, when numberFilesOnUploadChk is not checked
     end;

//  if not numberFilesOnUploadChk.checked then exit;   wrong line

  if numberFilesOnUploadChk.checked then
   begin
    ....
   end;

  assignFile(data.f^, data.uploadDest);
  end; // getUploadDestinationFileName


It is quite small nothingness which makes a big difference :D
Title: [upload-name] bug
Post by: rejetto on February 26, 2010, 10:04:30 AM
thank you mars. fixed in #255