Current location: Hot Scripts Forums » Programming Languages » PHP » unknown problem with upload script


unknown problem with upload script

Reply
  #1 (permalink)  
Old 08-30-04, 10:07 PM
rush989 rush989 is offline
Newbie Coder
 
Join Date: Aug 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Post unknown problem with upload script

Hi everyone!

I am trying to use this script I found to upload files from a form.

The form is on a separate page where the user browses for the file to upload and then when submit is pressed, on the next page is the upload code.

PHP Code:

copy ("$upload""uploads/$upload_name")

or die(
"Could not copy the file, please contact the webmaster."); 
"$upload" was the name of the file field in the forum and "uploads" is the destination.

This script works fine with smaller files but when I try to upload larger files (about 1 MB) I get the "Could not copy the file" error. Most of the files that I will be uploading will be over 1 mb.

If anyone knows what is wrong, any advice would be greatly appreciated.

Thanks,
Adam
Reply With Quote
  #2 (permalink)  
Old 08-31-04, 01:16 AM
<?Wille?> <?Wille?> is offline
Junior Code Guru
 
Join Date: Jan 2004
Location: Helsinki, Finland
Posts: 666
Thanks: 0
Thanked 0 Times in 0 Posts
try with move_uploaded_file() and check maxfile size in php.ini (probably not with that name)
Reply With Quote
  #3 (permalink)  
Old 08-31-04, 01:39 AM
rush989 rush989 is offline
Newbie Coder
 
Join Date: Aug 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Yep, i checked the php.ini and it says the max file size is 2mb. Thats the problem.

How would I change that to be larger? Thanks
Reply With Quote
  #4 (permalink)  
Old 08-31-04, 01:56 AM
rush989 rush989 is offline
Newbie Coder
 
Join Date: Aug 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Okay, i figured out how to increase the file limit

Im on a shared server so i didnt have access to the php.ini so I added the line
php_value upload_max_filesize "10M"
to the .htaccess file and it worked


Thanks,
Adam
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating Website Script Problem Dainbramaged05 PHP 4 06-30-04 12:29 PM
Problem with Image Slideshow script jthornton13 JavaScript 1 06-24-04 09:27 PM
Upload Script Problem!!! seanknighton Perl 0 03-21-04 09:54 PM
will pay. php script needed. upload, resize, & email jamjammo Script Requests 4 02-29-04 08:30 PM
Help with my upload script TheMetsAreBad PHP 2 12-04-03 06:10 PM


All times are GMT -5. The time now is 04:24 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.