Assistance request installing SWFUpload

Posted on 2009-07-12
Medium Priority
Last Modified: 2012-05-07
Hi expert,
My goal is creating a site with a upload functionality like on this site:


I've got a Mowes portable web server running with Apache2, PHP5, MySQL installed. And I've unzipped the content from SWFUpload v2.2.0.1 Core.zip file to the www folder.
In this folder I've got this layout:

Core Changelog.txt
swfupload license.txt

Normally I expect to find a index.php but not in this distribution.

Please how can I reach my goal?

Question by:Steynsk
  • 3
  • 3

Expert Comment

ID: 24835950
Hi, there is sample PHP code for use with SWFUpload here:


use the files at the above URL to get you started. The file "test.php" is your index.php

There's also a user submitted sample with email notifcation here:


There's demos of various SQFupload implementations here:

 Use "View Source" to get the code you are looking for. Make the form actions be the "upload.php" script referenced at the first URL I supplied.


Author Comment

ID: 24840598
HI basic612,

Thanks for your reply and aditional information.

I've put the test.php and upload.php in place and they work.
But when I copy the source of this page:


I find two lines which each load a java script that I can't find:
<script type="text/javascript" src="js/fileprogress.js"></script>
<script type="text/javascript" src="js/handlers.js"></script>
Do you know where to find those?

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.


Accepted Solution

basic612 earned 2000 total points
ID: 24840737
there is also a queue js in there:


Author Comment

ID: 24843318
Hi basic612,

It almost works.

I have to click this link:

      <h1 id="logo"><a href="../">SWFUpload</a></h1>
And than the upload button reveals its self. The compete code is beneath.
I think the link has to be clicked to trigger the onload function.
It there a way to trigger this when the page loads?


<html xmlns="http://www.w3.org/1999/xhtml" >
<link href="css/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="swfupload.js"></script>
<script type="text/javascript" src="js/swfupload.swfobject.js"></script>
<script type="text/javascript" src="js/swfupload.queue.js"></script>
<script type="text/javascript" src="js/fileprogress.js"></script>
<script type="text/javascript" src="js/handlers.js"></script>
<script type="text/javascript">
var swfu;
SWFUpload.onload = function () {
	var settings = {
		flash_url : "Flash/swfupload.swf",
		upload_url: "upload.php",
		post_params: {
			"HELLO-WORLD" : "Here I Am",
			".what" : "OKAY"
		file_size_limit : "100 MB",
		file_types : "*.*",
		file_types_description : "All Files",
		file_upload_limit : 100,
		file_queue_limit : 0,
		custom_settings : {
			progressTarget : "fsUploadProgress",
			cancelButtonId : "btnCancel"
		debug: false,
		// Button Settings
		button_image_url : "XPButtonUploadText_61x22.png",
		button_placeholder_id : "spanButtonPlaceholder",
		button_width: 61,
		button_height: 22,
		// The event handler functions are defined in handlers.js
		swfupload_loaded_handler : swfUploadLoaded,
		file_queued_handler : fileQueued,
		file_queue_error_handler : fileQueueError,
		file_dialog_complete_handler : fileDialogComplete,
		upload_start_handler : uploadStart,
		upload_progress_handler : uploadProgress,
		upload_error_handler : uploadError,
		upload_success_handler : uploadSuccess,
		upload_complete_handler : uploadComplete,
		queue_complete_handler : queueComplete,	// Queue plugin event
		// SWFObject settings
		minimum_flash_version : "9.0.28",
		swfupload_pre_load_handler : swfUploadPreLoad,
		swfupload_load_failed_handler : swfUploadLoadFailed
	swfu = new SWFUpload(settings);
<div id="header">
	<h1 id="logo"><a href="../">SWFUpload</a></h1>
	<div id="version">v2.2.0</div>
<div id="content">
	<h2>SWFObject Demo</h2>
	<form id="form1" action="index.php" method="post" enctype="multipart/form-data">
		<p> This page demonstrates the SWFObject plugin.  Do each of the following (one at a time) to see the plugin work: </p>
				<li>Uninstall your Flash Player or install a version less than 9.0.28</li>
				<li>Cause the SWF file to fail to load by deleting or renaming swfupload.swf (simulating a very slow or failed download)</li>
				<li>Disable JavaScript</li>
			Each of these tests demontrate how these issues can be handled by SWFUpload and the SWFObject libraries.
		<div id="divSWFUploadUI">
			<div class="fieldset  flash" id="fsUploadProgress">
			<span class="legend">Upload Queue</span>
			<p id="divStatus">0 Files Uploaded</p>
				<span id="spanButtonPlaceholder"></span>
				<input id="btnCancel" type="button" value="Cancel All Uploads" disabled="disabled" style="margin-left: 2px; height: 22px; font-size: 8pt;" />
				<br />
			<div style="background-color: #FFFF66; border-top: solid 4px #FF9966; border-bottom: solid 4px #FF9966; margin: 10px 25px; padding: 10px 15px;">
				We're sorry.  SWFUpload could not load.  You must have JavaScript enabled to enjoy SWFUpload.
		<div id="divLoadingContent" class="content" style="background-color: #FFFF66; border-top: solid 4px #FF9966; border-bottom: solid 4px #FF9966; margin: 10px 25px; padding: 10px 15px; display: none;">
			SWFUpload is loading. Please wait a moment...
		<div id="divLongLoading" class="content" style="background-color: #FFFF66; border-top: solid 4px #FF9966; border-bottom: solid 4px #FF9966; margin: 10px 25px; padding: 10px 15px; display: none;">
			SWFUpload is taking a long time to load or the load has failed.  Please make sure that the Flash Plugin is enabled and that a working version of the Adobe Flash Player is installed.
		<div id="divAlternateContent" class="content" style="background-color: #FFFF66; border-top: solid 4px #FF9966; border-bottom: solid 4px #FF9966; margin: 10px 25px; padding: 10px 15px; display: none;">
			We're sorry.  SWFUpload could not load.  You may need to install or upgrade Flash Player.
			Visit the <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash">Adobe website</a> to get the Flash Player.

Open in new window


Author Closing Comment

ID: 31602621
Thanks for the help I did not solve the problem but found a easier sollution:

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question