LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-30-2004, 10:19 PM   #1
kleptophobiac
Member
 
Registered: Jun 2003
Distribution: Arch
Posts: 315

Rep: Reputation: 30
What's a good php upload script for this?


I don't know enough PHP to write my own uploader, so I'm looking for a GPLed uploader. What's a good one?

Requirements:
modifiable without license breach
works up to ~200MB wav file
simple (no auth, nada, just a browse and an upload button necessary)

Thanks!

I've spent quite a bit of time searching, but I only found uploaders that seem to work for smallish files. I set the max post size (upload_max_filesize) in php.ini to 210MB.

Last edited by kleptophobiac; 01-30-2004 at 10:25 PM.
 
Old 01-30-2004, 11:24 PM   #2
crabboy
Senior Member
 
Registered: Feb 2001
Location: Atlanta, GA
Distribution: Slackware
Posts: 1,821

Rep: Reputation: 121Reputation: 121
Here is a code snipit for an upload that I use. You also need to specify a high php timeout value in the php.ini file as well as the upload file size.

Code:
function fileUploadPrompt()
{
   global $PHP_SELF;

   print "<form action=\"$PHP_SELF?option=file_upload\" method=\"post\" enctype=\"multipart/form-data\">\n";
   print "  Send these files:<br>\n";
   print "  <input name=\"userfile\" type=\"file\"><br>\n";
   print "  <input type=\"submit\" value=\"Send files\">\n";
   print "</form>\n";

}  // end fileUploadPrompt
Code:
function fileUpload()
{
   global $HTTP_POST_FILES, $HTTP_SERVER_VARS;
   $DestDir = dirname( $HTTP_SERVER_VARS['PATH_TRANSLATED'] ) . "/images";
   $NameArray = array();

   $Source = $HTTP_POST_FILES['userfile']['tmp_name'];
   $FileName =  $HTTP_POST_FILES['userfile']['name'];
   move_uploaded_file( $Source, $DestDir . "/" . $FileName );
<snip>

 // Do stuff with the file here
 
Old 01-31-2004, 07:06 AM   #3
kleptophobiac
Member
 
Registered: Jun 2003
Distribution: Arch
Posts: 315

Original Poster
Rep: Reputation: 30
Thanks!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can not upload image to site via php script vinsky2002 Linux - Software 0 03-15-2005 12:27 AM
Upload Script....but not php vous Programming 1 02-04-2004 02:13 PM
Any good apps to upload fles to website darin3200 Linux - Software 2 04-15-2003 09:45 PM
ftp upload in php raven Programming 2 07-07-2002 05:33 PM
File upload via PHP saravanan1979 Programming 1 02-14-2002 04:28 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration