views:

41

answers:

1

Not sure if too many of you are familiar with SWFUpload. It's a flash/js/php based uploading script. My main issue is that I'm decently fluent in php where I can create a simple mail() script, however, with the various JS files I'm not sure if it'd be better to create the mail function in JS.

If anyone has had experience with SWFUpload please advise me as to where I can create a script after the upload has completed.

Thanks in advance.

+2  A: 

I'm 100% sure somebody asked the same thing a few weeks ago, but I can't find the duplicate. Anyway, the conclusion was:

  • You can't put the sending of the E-Mail into the PHP or ASP script that receives the file, as that won't work for multiple uploads (each gets its own script instance)

  • You need to make an Ajax call to a PHP file that sends the E-Mail and place that call into the complete (or success) callback of SWFUpload.

Pekka
I don't think it needs to be that complex of an AJAX call. I was thinking a simple mail() function right after the 'complete'
Austin
@Austin you can't send E-Mail from pure Javascript. You'll need a server-side script for that, and an Ajax call is the simplest way to trigger it.
Pekka
@Pekka, Thanks I guess that does sum it up.
Austin