Page 3 of 3 FirstFirst 123
Results 21 to 30 of 30

Thread: copying image files from local server to remote server

  1. #21
    Join Date
    Sep 2009
    Posts
    24
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    Please let me clear the issue :

    1. wamp server is in my local computer and I don't have any problem with my wamp server, it is working perfect.

    2. my remote server is hosted in another location and this problem began after my remote server was upgraded to php ver 5.2.9-1

    3. Yes, I'm getting the following error message on remote server, not on wamp :

    Warning: copy(C:\wamp\www\noyaevofis\images\bg.GIF) [function.copy]: failed to open stream: No such file or directory in ....

    Is there any posts I missed to reply? If so please remind me.

    Thank you.

  2. #22
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    557
    Thanks
    8
    Thanked 66 Times in 66 Posts

    Default

    There are numerous that can be causing the upload limitations: MAX_UPLOAD_SIZE, MAX_INPUT_TIME, MEMORY_LIMIT, MAX_EXECUTION_TIME, etc.
    - Josh

  3. #23
    Join Date
    Sep 2009
    Posts
    24
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    Yes, you're right, there are.

    I also replaced MAX_UPLOAD_SIZE as a hidden input element on the form, but no use.

    Hoping........

    Nejat

  4. #24
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    557
    Thanks
    8
    Thanked 66 Times in 66 Posts

    Default

    It's a more stable solution if you create a php.ini file, and upload it to your web server.

    Here's an example for you:
    http://www.reallylinux.com/docs/php.ini
    - Josh

  5. #25
    Join Date
    Apr 2008
    Location
    Limoges, France
    Posts
    395
    Thanks
    13
    Thanked 61 Times in 61 Posts

    Default

    Quote Originally Posted by psikolog View Post
    Please let me clear the issue :

    1. wamp server is in my local computer and I don't have any problem with my wamp server, it is working perfect.

    2. my remote server is hosted in another location and this problem began after my remote server was upgraded to php ver 5.2.9-1

    3. Yes, I'm getting the following error message on remote server, not on wamp :

    Warning: copy(C:\wamp\www\noyaevofis\images\bg.GIF) [function.copy]: failed to open stream: No such file or directory in ....
    This is my last reply:

    If your REMOTE SERVER is NOT RUNNING WAMP, then C:\wamp\www\noyaevofis\images\bg.GIF is NOT A VALID PATH on your REMOTE SERVER and you MUST CORRECT THE PATH. That is why you are getting the NO SUCH FILE OR DIRECTORY ERROR.

    It is as simple as that.

    Sorry for being frustrated. I feel like I have said the same thing numerous times and you guys just aren't getting it. Maybe I'm not clear enough...

  6. The Following User Says Thank You to JasonDFR For This Useful Post:

    psikolog (09-02-2009)

  7. #26
    Join Date
    Sep 2009
    Posts
    24
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    I think first of all I should talk to my host admin and renew php installation.

    As far as I can see this is my only chance for the time being.

    Thank you all for your support.

    Nejat

  8. #27
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    557
    Thanks
    8
    Thanked 66 Times in 66 Posts

    Default

    But he's NOT talking about his Wamp server! Wamp runs on your local machine. He's talking about the SERVER! The SERVER is the issue. His files are not uploading on the SERVER, and THEREFORE it's NOT an issue with NO SUCH FILE OR DIRECTORY.

    I'm not sure why you posted that code, he's NOT having a problem with wamp.

    Please let me clear the issue :

    1. wamp server is in my local computer and I don't have any problem with my wamp server, it is working perfect.
    No problem with wamp.

    2. my remote server is hosted in another location and this problem began after my remote server was upgraded to php ver 5.2.9-1

    3. Yes, I'm getting the following error message on remote server, not on wamp :
    He may be getting an error on wamp, but since it's the SERVER he's concentrated on, the error on wamp is irrelevant. The focus of the issue is the SERVER
    - Josh

  9. #28
    Join Date
    Apr 2008
    Location
    Limoges, France
    Posts
    395
    Thanks
    13
    Thanked 61 Times in 61 Posts

    Default

    I can't believe I am replying again, but here it goes:

    Jshor, This is a quote from the guy asking the question:

    3. Yes, I'm getting the following error message on remote server, not on wamp :

    Warning: copy(C:\wamp\www\noyaevofis\images\bg.GIF) [function.copy]: failed to open stream: No such file or directory in ....
    The same that you just quoted, though you left the error message out of your quote. Notice how he says he is getting the above error on his REMOTE SERVER. If his remote server is not running WAMP EDIT:"and doesn't have a c:\wamp directory (although unlikely, it is possible that a server not running wamp have a wamp directory)", and for all we know might not even be a windows server, how is it possible to use this path: C:\wamp\www\noyaevofis\images\bg.GIF in a function executed by his remote server. Explain to me how that makes sense to you.

    Is your remote server a windows server or linux?

    This really is my last post. Good luck. If you figure it out, please post the solution.
    Last edited by JasonDFR; 09-02-2009 at 07:08 PM. Reason: Added "and doesn't have a c:\wamp directory.."

  10. The Following User Says Thank You to JasonDFR For This Useful Post:

    psikolog (09-02-2009)

  11. #29
    Join Date
    Sep 2009
    Posts
    24
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    I checked up the php installation time for my remote server (web) : May 27 2009 10:39:32

    My last successful file-upload to this server on June 16 2009 22;34

    Therefore server configuration does not have too much meaning any more, am I right?

    On the other hand my last successful uploaded-file-path was also C:\wamp\www\noyaevofis\images\.....

    The reason is that I do all my scripting in my local server (wamp), I test the scripts in my local (wamp), if everything is ok then I transfer my scripts to remote server (web) and I test the scripts once more on remote server (web).

    All the scripts running on remote server (web) must be the same scripts as running on my local (wamp) server. And all the directory structure must be the same in both servers. And they are same. Otherwise I must write different scripts for each server which is meaningless.

    If I eliminate the server configuraton then only one possibility remains :

    The DOM and HTML5 changes affected copy() function.

    Maybe this issue must be my new research topic.

    Anyway, thank you all again.

    Best regards.

    Nejat

  12. #30
    Join Date
    Sep 2009
    Posts
    24
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default

    I solved the problem today at 10:33 GMT+3.

    It has nothing to do with neither php version nor directory structure/naming.

    It is because of the way that HTML5 handles the POSTed data. Depending on this change in HTML5, the copy() function is handling the source file as : "The source file of the copy() function must be the temp_name not the full path."

    $recName = $_FILES['file_name']['temp_name']

    This link may give a brief idea about new HTML5 and DOM specs. : http://www.mail-archive.com/whatwg@l.../msg14076.html

    The following final code is tested on 2 different remote servers for IE and FireFox. No errors occured, all the files POSTed were saved into the related directories in both explorers.

    PHP Code:
    <?php 
        
        
    if (!isset($_REQUEST['PLogo'])) {$PLogo="";}  else    $PLogo $_REQUEST['PLogo'] ;
        if (!isset(
    $_REQUEST['Pname'])) {$Pname="";}  else    $Pname $_REQUEST['Pname'] ;
        if (!isset(
    $_REQUEST['action'])) {$action="";}  else    $action $_REQUEST['action'] ;
    ?>
    <form name="Fedit" method="post" enctype="multipart/form-data">

    <table align="center" width="600" cellspacing="2" cellpadding="2" style="border:1px outset #ECECEC;">
      <tr>
        <td bordercolor="#ececec" class="urunkart">Logo : </td>
        <td bordercolor="#ececec">
          <input type="file" name="PLogo" size="70" style="font:7pt verdana;color:#003399" >
        </td>
      </tr>
      <tr>
        <td bordercolor="#ececec" class="urunkart">Name for Logo : </td>
        <td bordercolor="#ececec"><input type="text" name="Pname" size="50" maxlength="255" style="font:7pt verdana;color:#003399"></td>
      </tr>
      <tr>
        <td bordercolor="#ececec" align="center" colspan="2">
          <input    type="submit"    name="action"    value="Save" onmouseover="this.style.cursor='pointer';">
        </td>
      </tr>
    </table>

    </form>
        
    <?     

         $action 
    strtolower(trim($action));

         switch(
    $action)
         {
                   case
    "save" action_update($PLogo,$Pname);   

                break;       
         }


      function 
    action_update($PLogo,$Pname)
      { 
        
    $PLogo $_FILES['PLogo']['tmp_name'] ;

        if (
    $PLogo !=="" )
        {
          
    chdir("./logo");
          if (
    copy($PLogo$Pname)) { echo ("$PLogo saved"); }    else { echo ("$PLogo is not saved");  }
          
    chdir("..");
        }
      }
    ?>
    I thank all of you for your valuable supports.

    Nejat

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •