| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
stuck in the '90s
Join Date: Jun 2008
Location: Baltimore, MD, USA
Posts: 123
|
Need help with a PHP upload script
I've searched through the results on here for PHP upload and found mostly links for tutorials. Mind you, the tutorials are great, however, they offer no help if something doesn't work. Thus, I turn to here. I am relatively new to PHP (okay, so I know nothing) howver a client needs this to work. All I'm looking for is a super simple upload script to upload pictures to a different folders, specified by the user, on the server. The server is a shared Unix one that supposedly has all the PHP framework and etc. installed. However, every time I try to run the script, I keep getting an Internal Server Error. I made sure to upload CHMOD (755) and everything that the tutorial included. I just can't get past this error. Any help would be greatly appreciated. |
|
|
|
|
|
#3 (permalink) |
|
I like code.
|
There are a lot of free scripts you can find out there for what you need. http://www.verot.net/php_class_upload.htm http://www.phpsimplicity.com/scripts.php?id=3 Secure File Upload with PHP HyperSilence.net - Silentum Uploader - PHP Upload Script Of you can use the script below. Just save this as something like FileUpload.php PHP Code:
Then use this to upload files. Don't forget to change "/path/to/uploadfile.php" to point to whatever you saved the above script as. PHP Code:
Last edited by Cborrow : 18-07-2008 at 10:44. |
|
|
|
#4 (permalink) |
|
Multimedia Developer
Join Date: Jun 2008
Location: Cheshire
Posts: 259
|
this might help also
try this as an addition http://t1.eu-guild.net/admin/_sitestyle/SWF.rar upload swf / fla file included. just point it at your upload php file |
|
|
|
#5 (permalink) |
|
stuck in the '90s
Join Date: Jun 2008
Location: Baltimore, MD, USA
Posts: 123
|
Thank you Cborrow for posting those. This will show my newbness to php. I realize that the first is for the first upload page, but what do I do with the second script? Dedicated PHP page with nothing but that? EDIT: After trying the script with it's own dedicated page I get the following error: Warning: preg_match() [function.preg-match]: Unknown modifier '(' in /home/u3/nrdadmin/html/UploadScript.php on line 40 Upload is too large, is the maximum |
|
|
|
#6 (permalink) | |
|
Registered User
|
Quote:
Is that last line truncated? I'm guessing you just need to edit your php.ini and increase your maximum file upload. |
|
|
|
|
#7 (permalink) |
|
stuck in the '90s
Join Date: Jun 2008
Location: Baltimore, MD, USA
Posts: 123
|
I got the "Secure Upload with PHP" tutorial to work! So excited. |
|
|
|
#9 (permalink) |
|
stuck in the '90s
Join Date: Jun 2008
Location: Baltimore, MD, USA
Posts: 123
|
Thanks man. I got it working. I want to find a simple progress loader, but with what I've accomplished today, I'm happy! Unless you have a simple example btw: You're not far from me! Our employees are working in chesapeake right now. |
|
|
|
#10 (permalink) |
|
Registered User
|
PHP is a pain in the ass to write a file upload progress bar. However, I believe there are some scripts floating around the web that will work. I've never used them myself, as I've never had a need to track upload progress. Brady » PHP File Upload Progress Bar ^^ Check that out. |
|
|
|
#13 (permalink) |
|
I like code.
|
Yeah, mostly all of the file upload scripts that had a progress bar required something like Perl or another language that directly reads the HTTP output. While looking around it looks like PHP can do it with the help of the APC_* functions and extension. Here are a couple of progress bars to add to the one hobolooter posted. Joshua Eichorn's Blog » Blog Archive » PHP AJAX File Upload Progress Meter Updates SourceForge.net: Mega Upload Progress Bar Web Reflection: Upload progress bar with PHP5, APC and jQuery |
|
|
|
#14 (permalink) |
|
Registered User
Join Date: Sep 2006
Posts: 3
|
I don't know if you have an aversion towards javascript, but I recently had a client who required a multi-upload feature and found the following (dhtmlxVault) which was dead simple to use and configure. The actual uploading and progress report is done server-side while all the prettiness comes from js and css. I also had a look at the SWF Upload linked earlier in this thread, but it was a mission to get working to be honest and requires the Flash player on the end-user's browser. I should add that the version with the progress bar is not free, but it is worth looking at. With a bit of ingenuity you could always implement the progress bar in the free version anyway. I would have posted the link but it seems as if I am not allowed to add links yet |
|
![]() |
|