NetTalk Central

Author Topic: Plupload and NT7  (Read 3649 times)

bshields

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
    • Inhabit
    • Email
Plupload and NT7
« on: August 07, 2013, 05:38:36 AM »
Hi,

In one of my apps I have been using Plupload (http://www.plupload.com/) for fancy multifile uploading.

It has all been working fine, but i've upgraded to NT7.18 and now its not working.

Its all a bit complicated and i'm just after some clues as to where to start diagnosing.

The plupload system is still working and is doing a POST like it used to, at the moment the NT server doesn't save the file.

In NT6.37 I just created a NetWebPage (which is where the plupload POSTs to) and the NT Server would save the file - magically :) - and my code inside the NetWebPage would then resize, move, etc.

Everything still operates as it did before, except the file is no longer "magically" saved anywhere for me.

My question, is with all the changes to the uploading system, is there anything I need to do let the NT Server know that I want the file saved when it is part of a normal POST (that essentially originates outside NT - well via a JS library).

Oh, and I do like the work thats been done, on the upload system, and I now use it for more normal upload stuff, but the plupload system, is sexy and I want to continue to use it so replacing it with the new system is only a very last resort.

Regards
Bill

bshields

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
    • Inhabit
    • Email
Re: Plupload and NT7
« Reply #1 on: August 07, 2013, 06:43:09 PM »
Hi Me, Appears the .SaveFile call (after setting the filename) seems to do the work now in the destination POST function. :)


Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Plupload and NT7
« Reply #2 on: August 07, 2013, 09:27:06 PM »
Hi Bill,

yes, this is one of the differences internally between NT6 and NT7.

In NT6 the incoming file was saved by the WebHandler regardless of whether it was "expected" or not. That's not a bad thing, but it does open the door to rouge posts being able to simply send you giant files without you really knowing about it.

In NT7, the save is now done by the form itself. (Using the Savefile call). This allows the form to have greater control over where the file is saved, how it is named and so on. And if the Post is "invalid" (ie ends up on no form, or a form not expecting a file upload) then the disk is not polluted.

So a simple call to SaveFile should sort you out, in your NetWebPage - but let me know if you need more.

cheers
Bruce



Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Plupload and NT7
« Reply #3 on: August 07, 2013, 09:29:35 PM »
Incidentally, you can now also limit the size of a POST to some arbitrary limit, on the security tab of the WebServer procedure. This prevents over-large files from being uploaded.

cheers
Bruce

bshields

  • Sr. Member
  • ****
  • Posts: 392
    • View Profile
    • Inhabit
    • Email
Re: Plupload and NT7
« Reply #4 on: August 14, 2013, 03:07:37 AM »
Thanks Bruce, its much nicer now, having the save file and file name code in the page that expects them. I can clean some stuff up!