473,414 Members | 1,575 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

file transfer in php

Hi

How to upload larger files (nearly 50 MB size) in php .
I tried ,
if(move_uploaded_file($_FILES["file"]["tmp_name"],"/home/lcscon/public_html/admin/".$_FILES["file"]["name"]))
{
echo "File has been uploaded .";
}
else
{
echo "Not Uploaded";
}
?>

I even tried ,

$upload = ftp_put($conn_id,$destination_file,$source_file,FT P_BINARY);

But it fails. It upload upto files of max size 7 MB.

MAX_FILE_UPLOAD size in php.ini file edited to 80 MB (from 2M).
POST MAX SIZE also configured to large enough.

How can i upload larger files ? Or is there any sample available for uploading larger files (50 MB) .

Thanks in advance
somaskarthic
Dec 8 '06 #1
4 2701
steven
143 100+
Provided your values are correct in the config, I can't see why it shouldn't work.

Be certain that in your php.ini you haven't used 'MB'. It should be '50M', without the quotes of course.

You will also need to make sure the hidden field in your form is correct and should be:

[html]<input type="hidden" name="MAX_FILE_SIZE" value="xxx" />[/html]

In your case, 'xxx' should be:

52428800 for 50MBytes and 83886080 for 80MBytes.

I know you said that you had these set already, but please make sure the values are correct and maybe post your code. I also see that you say you have post max size correctly set too....

According to php.net,

If memory limit is enabled by your configure script, memory_limit also affects file uploading. Generally speaking, memory_limit should be larger than post_max_size.
http://fr.php.net/manual/en/ini.core....post-max-size

http://fr.php.net/manual/en/features...n-pitfalls.php
Dec 8 '06 #2
steven
143 100+
Damn the edit block...

Also note:

max_input_time sets the maximum time, in seconds, the script is allowed to receive input; this includes file uploads. For large or multiple files, or users on slower connections, the default of 60 seconds may be exceeded.
From php.net

Read those links. I'm sure there are many other factors you need to consider to enable these large uploads. Good luck.
Dec 8 '06 #3
Hi

I need to know all the possibe settings that has to be made for uploading larger files (app. 50 MB) in php. Let me know some links or sample php.ini configuration file for large uploads. I tried most of the possibilites. I don't know where the problem lies. Please give me the clear steps to be followed.


Thanks in advance.
somaskarthic





Damn the edit block...

Also note:



From php.net

Read those links. I'm sure there are many other factors you need to consider to enable these large uploads. Good luck.
Dec 28 '06 #4
ronverdonk
4,258 Expert 4TB
I need to know all the possibe settings that has to be made for uploading larger files (app. 50 MB) in php. Please give me the clear steps to be followed.
Anything else to order?

Ronald :cool:
Dec 28 '06 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Lingyun Yang | last post by:
*** post for FREE via your newsreader at post.newsfeed.com *** Dear all, I have a file it's binary data viewed in UltraEdit is EF BB BF 0D 0A 3C ....... I want to read them into a int or long...
11
by: Abhishek | last post by:
I have a problem transfering files using sockets from pocket pc(.net compact c#) to desktop(not using .net just mfc and sockets 2 API). The socket communication is not a issue and I am able to...
11
by: Stephan Steiner | last post by:
Hi Generally, FileInfo fi = new FileInfo(path); long size = fi.Length; gets you the length of a file in bytes. However, when copying files, even while the copy operation is still in...
8
by: Xarky | last post by:
Hi, I am downloading a GIF file(as a mail attachement) with this file format, Content-Transfer-Encoding: base64; Now I am writing the downloaded data to a file with this technique: ...
15
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update...
1
by: Alex | last post by:
Hello, I'm trying to write a little php script to transfert some files from a server to clients (web/http). It's working fin with small files. But transfering big files (try on 1Gb) failed!...
10
by: David | last post by:
I have googled to no avail on getting specifically what I'm looking for. I have found plenty of full blown apps that implement some type of file transfer but what I'm specifcally looking for is an...
2
by: tedpottel | last post by:
Hi, My program has the following code to transfer a binary file f = open(pathanme+filename,'rb') print "start transfer" self.fthHandle.storbinary('STOR '+filename, f) How can I do an ASCII...
0
by: fiona | last post by:
Yucca Valley, CA, - October 2007: Catalyst Development Corporation, publisher of SocketTools, SocketWrench and LogicGem, today announced the release of Catalyst File Transfer .NET V5.0. For...
6
by: Thom Little | last post by:
I need to transfer an XML file between an application on the client and the server. This would in fact be a copy of the application's .config file. HTML <input form=...would transfer the file...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.