Uploading Images into Shockwave (without Xtras)

Testing image upload system to upload images to server and then loading the uploaded image into Shockwave (using and a small bit of Javascript).

The basic way this system works is the shockwave movie tells the brower to open a window with the 'select file to upload form'. This window uses to enable the user to select then upload a file. When the file is uploaded, the 'upload window' then reloads itself with a hidden shockwave, writing the url of the uploaded file to as 'sw' parameter of the shockwave movie. This hidden shockwave then writes out the selected file using setPref. The hidden shockwave then reloads the window for a third time to display the close button. Meanwhile, the original shockwave reads the pref file to get the uploaded file path.

The source files are here - note that this is a test and I haven't cleaned up the code (and there are no comments or anything helpful yet). To get up and running, you will need to modify the following two lines in the 'upload' file:

$uploadDir = '/www/lingoworkshop/testzone/uploads/'; 

... 

$uploadURL = "/testzone/uploads/" . $_FILES['userfile']['name'];

$uploadDir is the local path to the directory you will be uploading to. $uploadURL is the URL that shockwave will use to find the uploaded file. You will also need to make sure that the upload directory is writable by

First published 29/06/2005