I created an easy to implement upload.php with simple file saving and email reporting. A good "getting started" upload primer.
There is no built in security with this script, so it should *NOT* be used in production environments!
| Attachment | Size |
|---|---|
| upload.php_.txt | 5.81 KB |
April 10, 2009 - 8:56am
Exactly what I needed, thanx Eric P
April 17, 2009 - 9:05am
Hello,
this script works fine.
But how can I make an output on the html website with the infos from the mailsend (not/successful, to cc recipients...)?
Thanks
Best Regards
Hillenbrand
April 23, 2009 - 12:30pm
Hey love this script helped me out alot.
What I need is a way to have the upload directory change.
Basically, I want the user to select a directory that is stored in the url under a variable, is there a way I can pull the variable and make that the new $upload_directory.
I have tried the get, and hidden method both have had no success in this.
April 26, 2009 - 12:10pm
Hi Eric,
Just wanted to says thanks. Finally I have a working example that works fine on my server and have a great starting point to develop from.
Would be great if others could also share simple ideas like this for beginners.
Thanks
David
June 2, 2009 - 3:56pm
Provided me with a great starting point for my app.
Thanks
Janice
July 20, 2009 - 4:05pm
I am using this sample and can't seem to get it to complete and save the upload.
Any suggestions?
August 6, 2009 - 6:41pm
If there is no security, why can we use it? I am looking for a way to use it in Joomla, but for sending uploads to Amazon S3..
September 16, 2009 - 12:59pm
In the Application Demo I constantly get the error : Flash requires that we output something or I wont fire ...
How can I fix it?
September 23, 2009 - 8:56am
Hello. I'm new to SWFUpload, just discovered it for a few hours, so go easy on me please.
I can't seem to make it work if I put another value to $upload_directory variable from upload.php file. I need another value there, but it doesn't work.
With $upload_directory ='upload' statement, the script works just fine.
If ( !$upload_directory ) {
$upload_directory = '../../cms_documents/test'; // this fails to work
...
}
Thank you!
September 24, 2009 - 2:36am
Never mind...
The solution stands in the lines below.
Simply needed to edit those lines:
$parent_dir = array_pop(explode(DIRECTORY_SEPARATOR, dirname(__FILE__)));
$upload_directory = substr(dirname(__FILE__), 0, strlen(dirname(__FILE__)) - strlen($parent_dir) ) . $upload_directory ;
Thanks anyway!
October 25, 2009 - 4:28pm
I've spent 3 hours trying to figure it out and it still won't upload.
The error I get is:
PHP Error:Save Path: /***domainpaths***/html/swf/demos/uploads/
$_FILES data:
Array
(
[resume_file] => Array
(
[name] => eula.1042.txt
[type] => application/octet-stream
[tmp_name] => /tmp/phpG8z4vk
[error] => 0
[size] => 17734
)
)
Any idea what's going on here? Thanks for your help.
October 26, 2009 - 10:09am
That doesn't look like an error. It looks like the output from PHP for a successful upload.
November 11, 2009 - 9:55am
If I use this script I receive this email:
PHP Error:
Save Path: /usr/home/deb12019/domains/cvdeklepperbekken.nl/public_html/2009/fotos/
$_FILES data:
Array
(
)
So my swfupload doesn't send a file. I'm using this upload script with the resize demo.
Maybe someone has a solution?
Thanks for you help
November 11, 2009 - 10:13am
(this should probably be a new thread)
Check out the upload.php from the resize demo. If you send a resized image we aren't allowed to send it as a file upload ($_FILES) because of security restrictions in the Flash Player (yes, it is stupid and only makes life difficult for legitimate developers, as anyone stealing data without the user knowledge can still send it and doesn't particularly care if the world "FileName" appears in the post).
So the data is sent as a post value and you should be able to find it in $_POST["Filedata"].
Also, the alpha 1 doesn't seem to work under IE7 with some versions of the Flash Player. This has been fixed in the SVN repository and a second alpha release is coming soon.
November 12, 2009 - 9:58am
I've changed it to $_POST[Filedata] but still nothing.
I made a new thread about this problem, maybe you can have a look over there. It's called 'resize demo with upload script'.
It still isn't working
Hope someone can help me.
Thanks
December 7, 2009 - 3:50pm
I'm very grateful for you coming up with this code as a starting point. I am having a bit of some trouble if anyone can help me.
Based off the Simpledemo php page, upload.php works well with basic small files. I have tested with files under 6mb and they get uploaded to my directory just fine... but I have tried uploading a 17mb image as a test but I don't know if this is a script error or a file size error. I have my upload size limit at 100mb. I also get an email report saying "SWFUpload Failure:
PHP Error:
Save Path: /home/content/80/5277280/html/uploader/uploads/
$_FILES data:
Array
(
)"
I ONLY get this message when the file happens with these bigger files.
Not to mention the progress bar on the Simpledemo index.php page says that the upload was complete.
I am using Safari build 4.04 and I did come across something on the forum saying that SWFUpload v2.2.0 has some issues with Safari and not uploading files corretly... does anyone know how this can be resolved?
December 8, 2009 - 11:51am
Sounds like a server issue and that you haven't configured your php.ini to allow larger that 8 MB posts.
June 2, 2010 - 10:56am
First of all, my heartfelt thanks to Eric for providing this working example. I am an amateur volunteer webmaster for a non-profit sports club and have been looking for a way to permit visitors to upload photos. I have very little scripting knowledge so this is exactly what I was looking for.
I have managed to get the script working, but I would like for individuals who are uploading photos to include some other information (e.g., photographer name, E-mail address, tags for photos, etc). I know I can simply add text inputs to the main index.php form, but can anybody help me with some sample code for the upload.php script so that the content of those text inputs is included in the notification E-mail?
Thanks in advance!!!