|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #22387 Error Opening [File] in [PHPScript] on Line [linenumber]
Submitted: 2003-02-23 14:33 UTC Modified: 2003-02-24 06:48 UTC
From: tornbydesign at hotmail dot com Assigned:
Status: Not a bug Package: FTP related
PHP Version: 4.2.3 OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: tornbydesign at hotmail dot com
New email:
PHP Version: OS:


 [2003-02-23 14:33 UTC] tornbydesign at hotmail dot com
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???


Sorry for my bad english

[phpcut] opens the Sourcecode cut and [/phpcut] ends it.


$connection = ftp_connect(FTP_host);
    $login = ftp_login($connection, FTP_uid, FTP_pwd);

    $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>";




Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-02-23 17:27 UTC]
Please try using this CVS snapshot:
For Windows:

And if that doesn't work either, give us a complete,
self-contained but short example script which uses 
some public ftp site.

 [2003-02-24 06:39 UTC] tornbydesign at hotmail dot com
the script exists on a server by a big provider. this provider must have the newest version of php.
 [2003-02-24 06:48 UTC]
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit as this bug system is not the
appropriate forum for asking support questions. 

Thank you for your interest in PHP.

Please report bugs only when you are able to try solutions.

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Sat Dec 03 23:05:52 2022 UTC