Hi
I’m trying to put together a simple upload form using Filereference.
But the examples I’ve found and tried to use don’t quite work the way they should.
** Example 1:**
http://www.flash-db.com/Tutorials/upload/
I downloaded the source files, changed the
[COLOR=#000000][COLOR=#0000bb]System[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]security[/COLOR][COLOR=#007700].[/COLOR][COLOR=#0000bb]allowDomain[/COLOR][COLOR=#007700]([/COLOR][COLOR=#dd0000]"http://localhost"[/COLOR][COLOR=#007700], [/COLOR][COLOR=#dd0000]"127.0.0.1"[/COLOR][COLOR=#007700]); [/COLOR][/COLOR]
piece of it to reflect my domain name (although left the I.P alone)
and uploaded it to my server (created proper upload folder, with 777 permissions etc… as well).
The script uploads the small files I’ve selected to the proper folder.
BUT after the swf tries to upload the file, it stops doing anything. The file gets uploaded, but the Swf file doesn’t get any feedback, or doing anything. Just says thats its still trying to upload the file.
**
Example 2:**
http://www.kirupa.com/developer/flash8/uploading_fileReference_pg1.htm
I downloaded the Fla, published a HTML page and swf file from it, created a php script by copy pasting the code found on page 3 of the tutorial.
Uploaded the files, created proper upload directory, with 777 file permissions.
It does practically the same thing, I select a file with it, the file gets uploaded, but the progress bar doesn’t show up, and the form doesn’t reset itself. Its like as soon as the swf contacts the Php script, it doesn’t do anything anymore.
Example 2 used to work the exact opposite though, a couple days ago when I first tried it, the files would trigger the upload progress bar, but would hang at some percentage (like 60%, 40% etc…) and the file wouldn’t upload. Today I redownloaded the files, created a fresh directory on the server etc… pretty much started from scratch, and now the files show up, but I don’t get any feedback from the form.
I don’t know what to do…
The other day I tried to add the lines of code mentioned on the 4th page of the example 2 tutorial, to the global .htaccess file, but those lines of code, proceeded to kill all other php scripts running on my website, they just stopped working and produced error messages. So I had to remove the code lines. Its probable worth mentioning that the .htaccess file already had some lines of code in it to handle the redirecting of a particular URL away from the main index page onto a sub folder and its index page (as suggested by my web host)
Heres the links to the examples that fail to work for me:
** Example 1: **
http://albertaintegrated.com/tests/flash/Uploading/Upload01/upload.html
** Example 2:**
http://albertaintegrated.com/tests/flash/Uploading/Upload02/fileUploader.html
Heres the php scripts being used for them:
** Example 1**:
<?php
//create the directory if doesn't exists (should have write permissons)
if(!is_dir("./files")) mkdir("./files", 0755);
//move the uploaded file
move_uploaded_file($_FILES['Filedata']['tmp_name'], "./files/".$_FILES['Filedata']['name']);
chmod("./files/".$_FILES['Filedata']['name'], 0777);
?>
Example 2:
<?php
if ($_FILES['Filedata']['name']) {
move_uploaded_file($_FILES['Filedata']['tmp_name'], 'upload_directory/' . basename($_FILES['Filedata']['name']));
}
?>
And the links to the Flas involved are above.
Other then the change I mentioned I did on the Example 1 tutorial Fla, I assure you I left them untouched and identical to the ones you download from the tutorial pages.
I only need a simple Upload script. It doesn’t have to upload multiple files at a time. I just need something that works, and is simple enough that I can attach it to a small contact form, that will email the users name and contact information, as well as the name(s) of the file(s) the user uploaded.
I’d appreciate any and ALL help, pointers, and suggestions you or others may offer.
Links to alternative tutorials and examples would also be appreciated.
Although, I need to be able to make the upload form look a certain way to fit in with the rest of the site (as well as make it fit within a certain size space) so I don’t think some sort of component, where I couldn’t rearrange the elements would work very well.
Thanks for your time
-Lem