https://www.icyphoenix.com/viewtopic.php?f=35&t=2963
-----------------------------------
enridp
Fri 19 Oct, 2007 21:38

Use FTP To Upload Big Files
-----------------------------------
Hello !
I was trying for a long time to solve this:
My server limits the max file size to 8MB (via php). I know Icy has an option with FTP, but it doesn't work to me, and I don't know what's going wrong.
When the file to upload is less than 8MB the FTP mode works great, but when not, it seems that the file is uploading (at least it takes the same time...). But the file is not uploaded, then Icy shows this error:

[b]'No post mode specified';[/b]

I was searching it, and it come from posting.php:

[code linenumbers=false]message_die(GENERAL_MESSAGE, $lang['No_post_mode']);[/code]

I don't know how to solve it because I can't understand why "posting.php" works great when the file is less than 8MB and when it's greater posting.php is called without parameters (???).

I hope somebody help me, in spite of my bad english  :roll: 

henry.
PS: I'm using Icy 1.0.11.11


-----------------------------------
novice programmer
Sat 20 Oct, 2007 12:22

Re: Use FTP To Upload Big Files
-----------------------------------
[quote user="enridp" post="20605"]Hello !
I was trying for a long time to solve this:
My server limits the max file size to 8MB (via php). I know Icy has an option with FTP, but it doesn't work to me, and I don't know what's going wrong.
When the file to upload is less than 8MB the FTP mode works great, but when not, it seems that the file is uploading (at least it takes the same time...). But the file is not uploaded, then Icy shows this error:

[b]'No post mode specified';[/b]

I was searching it, and it come from posting.php:

[code linenumbers=false]message_die(GENERAL_MESSAGE, $lang['No_post_mode']);[/code]

I don't know how to solve it because I can't understand why "posting.php" works great when the file is less than 8MB and when it's greater posting.php is called without parameters (???).

I hope somebody help me, in spite of my bad english  :roll: 

henry.
PS: I'm using Icy 1.0.11.11[/quote]
Post the fuction where that message is included.


-----------------------------------
enridp
Sat 20 Oct, 2007 18:01

Re: Use FTP To Upload Big Files
-----------------------------------
is not a function, is part of posting.php:

[code]
//
// What auth type do we need to check?
//
$is_auth = array();
$is_auth_type = '';
$is_auth_type_cal = '';
switch( $mode )
{
	case 'newtopic':
		if ( $topic_type == POST_GLOBAL_ANNOUNCE )
		{
			$is_auth_type = 'auth_globalannounce';
		}
		elseif ( $topic_type == POST_ANNOUNCE )
		{
			$is_auth_type = 'auth_announce';
		}
		elseif ( $topic_type == POST_STICKY )
		{
			$is_auth_type = 'auth_sticky';
		}
		else
		{
			$is_auth_type = 'auth_post';
		}
		if (!empty($topic_calendar_time))
		{
			$is_auth_type_cal = 'auth_cal';
		}
		break;
	case 'reply':
	case 'quote':
		$is_auth_type = 'auth_reply';
		break;
	case 'editpost':
		$is_auth_type = 'auth_edit';
		break;
	case 'delete':
	case 'poll_delete':
		$is_auth_type = 'auth_delete';
		break;
	case 'vote':
		$is_auth_type = 'auth_vote';
		break;
	case 'topicreview':
		$is_auth_type = 'auth_read';
		break;
	case 'thank':
		$is_auth_type = 'auth_read';
		break;
	default:
		//MODIFICADO:
                //message_die(GENERAL_MESSAGE, $lang['No_post_mode']);
		        //-------------------------
                        $is_auth_type = 'auth_post';
                        $mode = 'newtopic';
		        //-------------------------
		break;
}
[/code]

How you can see, I have commented the error line, but that's not the problem, a new error appears, apparently posting.php is called WITHOUT parameters (mode, forum, etc.), and I don't know why... I mean, if the file size is < than 8MB it works great...
I can't see why posting.php is called without parameters when the file is >8MB...


-----------------------------------
novice programmer
Sun 21 Oct, 2007 12:14

Re: Use FTP To Upload Big Files
-----------------------------------
Have you tried to raise the php memory?


-----------------------------------
enridp
Sun 21 Oct, 2007 17:57

Re: Use FTP To Upload Big Files
-----------------------------------
to raise the php memory?
I don't know how to do it  :( 
The server where I'm has a limit for the file sizes: 8MB.
I don't know the memory_limit and I can't touch that (I can't modify php.ini)
Mighty says, some time ago, is possible to upload bypass the 8MB php limit with the FTP option:
http://www.icyphoenix.com/viewtopic.php?t=2333&highlight=
But I can't make it wotk.


-----------------------------------
novice programmer
Sun 21 Oct, 2007 18:19

Re: Use FTP To Upload Big Files
-----------------------------------
[quote user="novice programmer" post="20635"]Have you tried to raise the php memory?[/quote]
I was meaning with [url=http://www.icyphoenix.com/viewtopic.php?f=4&t=2682]this topic


-----------------------------------
enridp
Sun 21 Oct, 2007 19:14

Re: Use FTP To Upload Big Files
-----------------------------------
Thanks again for your reply Novice !
But I can't find this line:
[code]
php_value memory_limit 32M
[/code]

Anyway, I was viewing the .htaccess, I think I could add something like this:
[code]
php_value max_execution_time 1000
php_value max_input_time 1000
php_value post_max_size 100M
php_value upload_max_filesize 100M
[/code]

But I think it won't solve the problem...
My last option is to make a function to use CGI instead of PHP to upload the files, but I don't want to reach that extreme.
Nobody knows a simpler solution?

[b]EDIT[/b]
OK, I'm testing with .htaccess:
php_value max_execution_time 1000  => Internal Server Error
php_value max_input_time 1000  => Internal Server Error
php_value post_max_size 100M  => Internal Server Error
php_value upload_max_filesize 100M  => Internal Server Error
php_value memory_limit 32M  => Internal Server Error
php_value memory_limit 16M  => Internal Server Error
php_value memory_limit 2M  => Internal Server Error
Conclusion: the .htaccess is not the solution  :(


-----------------------------------
enridp
Sun 21 Oct, 2007 23:27

Re: Use FTP To Upload Big Files
-----------------------------------
Thinking and reading a bit more, I can't see any way that a PHP script can read a file from a client computer to upload it to an FTP site. And I think these are good news, just think of the security implications. 
I think the FTP functions are designed to upload files from local server to another server. 
Then, how can we bypass the filesize limits from the server?. I think I can do it with CGI, but if there is an easier way, please tell me, I really need it.

Something "strange" that I've noticed is the time it takes the file to upload, I mean, when I'm posting a file > 8MB, it seems to delay more than an 8MB file, just like if the server was receiving more than 8MB... 
When you upload a file that is to large, it still goes to the server??, 
Is the check of the limit on the move_uploaded_file function?
If so, would be possible ftp the file from the temp directory to the ftp folder because the file is already on the server?


-----------------------------------
enridp
Tue 23 Oct, 2007 01:38

Re: Use FTP To Upload Big Files
-----------------------------------
nobody?  [img]http://www.icyphoenix.com/images/smiles/blink1.gif[/img]


-----------------------------------
novice programmer
Tue 23 Oct, 2007 16:18

Re: Use FTP To Upload Big Files
-----------------------------------
Try to update to 1.1.0.15b


-----------------------------------
enridp
Tue 23 Oct, 2007 17:42

Re: Use FTP To Upload Big Files
-----------------------------------
[quote user="novice programmer" post="20678"]Try to update to 1.1.0.15b[/quote]

Thanks Novice ! I really esteem your help.
But why do you think updating to 1.1.0.15b will solve the problem? I mean, my doubt is if the FTP mode can really bypass the limits from the server. Is this true? because I can't understand how... 
I think, and it's just that, a thinking, the problem is not the Icy version.
But maybe you know something more, could you explain me why you think it will be the solution? I mean, has somebody tested the FTP option to bypass the PHP limits from the server?

bye and thanks again!


-----------------------------------
novice programmer
Tue 23 Oct, 2007 20:15

Re: Use FTP To Upload Big Files
-----------------------------------
[quote user="enridp" post="20682"][quote user="novice programmer" post="20678"]Try to update to 1.1.0.15b[/quote]

Thanks Novice ! I really esteem your help.
But why do you think updating to 1.1.0.15b will solve the problem? I mean, my doubt is if the FTP mode can really bypass the limits from the server. Is this true? because I can't understand how... 
I think, and it's just that, a thinking, the problem is not the Icy version.
But maybe you know something more, could you explain me why you think it will be the solution? I mean, has somebody tested the FTP option to bypass the PHP limits from the server?

bye and thanks again![/quote]

I can´t answer your question, i don´t know how.
The thing i know is that i haven´t got that error with the version 1.1.0.15b.


-----------------------------------
difus
Tue 23 Oct, 2007 21:42

Re: Use FTP To Upload Big Files
-----------------------------------
maybe I'm not right , but I'm thinking there is no way to increase your upload size.
you have to contact server administration or change the hosting.

but your ftp must work  :roll:


-----------------------------------
enridp
Wed 24 Oct, 2007 00:56

Re: Use FTP To Upload Big Files
-----------------------------------
[quote user="difus" post="20687"]maybe I'm not right , but I'm thinking there is no way to increase your upload size.
you have to contact server administration or change the hosting.

but your ftp must work  :roll:[/quote]

Hello difus !
The FTP works fine, but with files < 8MB, just like PHP upload...
Are you saying this is correct? I mean, FTP option can't rise the size limits from PHP? that is my doubt right now, because Mighty says it should... but I can't make it work.


