#22387 [Opn->Fbk]: Error Opening [File] in [PHPScript] on Line [linenumber]
| From: | sniper@php.net | Date: | Sun, 23 Feb 2003 23:27:28 +0000 |
| Subject: | #22387 [Opn->Fbk]: Error Opening [File] in [PHPScript] on Line [linenumber] | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-34028@lists.php.net to get a copy of this message | ||
ID: 22387
Updated by: sniper@php.net
Reported By: tornbydesign at hotmail dot com
-Status: Open
+Status: Feedback
Bug Type: FTP related
Operating System: Windows
PHP Version: 4.2.3
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
And if that doesn't work either, give us a complete,
self-contained but short example script which uses
some public ftp site.
Previous Comments:
------------------------------------------------------------------------
[2003-02-23 14:33:41] tornbydesign at hotmail dot com
Hi,
I have a problem with FTP Fileupload.
if i execute the script i receive this message
'Warning: error opening C:\Images\any.jpg in ftp.php on line 90'
the ENCTYPE in form-tag is "multipart/form-data". Method is Get. I
receive the right Path information but it seems that the file couldn 't
be opened. File Upload is activated. The MaxFilesize is 20MB. I don't
know what it could be.
Ah, one thing: I must replace '\\' through '\' because the path which
is returned from the file-element is 'C:\\Images\\any.jpg'
Can you help me???
Thanks
Tornby
Sorry for my bad english
info:
[phpcut] opens the Sourcecode cut and [/phpcut] ends it.
[phpcut]
$connection = ftp_connect(FTP_host);
$login = ftp_login($connection, FTP_uid, FTP_pwd);
ftp_pasv($connection,true);
$iPos = 0;
$FTPError = "";
while ($iPos < 10)
{
If (!empty($HTTP_GET_VARS['file'.$iPos]))
{
$SourceFile =
str_replace('\\\\','\\',$HTTP_GET_VARS['file'.$iPos]);
$DestinationFile =
$destination.Substr($SourceFile,strrpos($SourceFile,'\\')+1,strlen($SourceFile)-strrpos($SourceFile,'\\')-1);
if (!
ftp_put($connection,$DestinationFile,$SourceFile,FTP_BINARY)) $FTPError
.= "Fehler beim hochladen von '$SourceFile'<br>";
}
$iPos++;
}
ftp_quit($connection);
[/phpcut]
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=22387&edit=1