Jump to content

Copy Issues


rseigel

Recommended Posts

I have the following line:
 

PHP Code:

It works with other suppliers I grab inventory files from but not this one. The file is not copied.

 

I've added this to the top of my script:

ini_set('post_max_size', '16M');
ini_set('upload_max_filesize', '16M');


This file is 1.31 MB if that makes a difference.

Their phpinfo file is at http://www.azuregreenw.com/phpinfo.php

Does anyone know what may stop it from copying and what I might be able to do to make it work?

Link to comment
Share on other sites

No.

 

Let me try to be clearer.

 

My supplier has a daily updated file that they store on their server. It essentially is for updating inventory counts on my web site.

 

I'm trying to get that file (by any means possible) and use it to update my inventory.

 

I have the code in place that will do that. I'm just having trouble copying the file from their server to mine.

 

Hopefully that makes more sense. :confused:

Link to comment
Share on other sites

This is what I have so far:

error_reporting(E_ALL);
ini_set('memory_limit', '4096M');
$csv = file_get_contents('http://www.azuregreenw.com/StockInfo.csv');
if ($csv === false)
{
    echo 'File not good!</br>';
} else {
    echo $csv;
}

No other erros are thrown.

 

Just:

File not good!

I'm at a loss at this point.

 

Thanks for all the help. Hopefully this creates an aha moment for someone.

Link to comment
Share on other sites

It IS possible, but more likely to be a memory constraint by your server. I know you say no errors are thrown, but when file_get_contents() fails, it should at least be throwing a warning. I think your server configuration is preventing them from being displayed altogether. Try adding this above your code:

ini_set('display_errors', 1);
Link to comment
Share on other sites

Finally we have a error message to deal with.

Warning: file_get_contents(http://www.azuregreenw.com/StockInfo.csv): failed to open stream: Connection timed out in /home1/aonewebs/public_html/AG_inventory_update.php on line 45

Does this mean there's nothing I can do unless I can convince my supplier to whatever controls that?

Link to comment
Share on other sites

Interesting. Are you behind a proxy? What happens if you change the URL to just http://www.google.com?

 

Those two config settings shouldn't cause any problems.

 

 

Does the owner of this website know you are doing this? It is possible they banned your IP simply because you were using too much bandwidth.

Edited by lemmin
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.