Author Topic: new events section or possible bug  (Read 1260 times)

0 Members and 1 Guest are viewing this topic.

Offline raybob

  • Tireless poster
  • ****
  • Posts: 453
    • View Profile
    • FileSplat.com
new events section or possible bug
« on: October 30, 2011, 10:23:31 PM »
(I realize now this should be in bugs section...)

Rejetto in hfs.events can you make a section called [upload] or something similar where macros are executed before an upload starts?  For example, the following code under [request] does NOT stop an upload from occuring:

Code: [Select]
{.if|{.count substring|multipart/form-data|{.header|Content-Type.}.}|{:{.disconnect.}:}.}

I get this in the log:
Code: [Select]
if|1|{:{.disconnect.}{.break.}:}
    {.disconnect.}{.break.}
disconnect
    <div class=macroerror>macro error: disconnect<br>not supported or illegal parameters</div>
break
« Last Edit: October 30, 2011, 10:27:37 PM by raybob95 »

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12890
    • View Profile
Re: new events section or possible bug
« Reply #1 on: November 02, 2011, 07:52:02 PM »
it's because the [request] is fired when the whole http request (upload included) was received.
I agree that it would be good to get it (or another event) fired as soon as the header only is received.
I put it in the to-do list.


The error you get in the log is very strange. I don't get it.
I get the disconnection, but too late (when the file is already uploaded).
I guess your script is different than the one you posted.

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12890
    • View Profile
Re: new events section or possible bug
« Reply #2 on: March 02, 2014, 02:15:15 PM »
will be available in version 2.3a