rejetto forum

[upload-name] bug

Mars · 2 · 2867

0 Members and 1 Guest are viewing this topic.

Offline Mars

  • Operator
  • Tireless poster
  • *****
    • Posts: 2059
    • View Profile
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
« Last Edit: February 21, 2010, 10:23:16 PM by Mars »


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile