hulkmaster Posted November 26, 2017 Share Posted November 26, 2017 Hi, I am quite new to programming and would need some help please. Getting crazy here I have a PHP Proxy Script and I try to get it to work. Here is the link to it: https://gist.github.com/m-thomson/c872e7da848ceba055ad036791daa32d I want to get as an outcome a .csv file what I then can use from an https site instead of ftp. Because my Wordpress plugin is not supporting ftp. I put all the information in and I get a download file but the file is empty. There should be all the Product data ect. in there. Can anybody help? Is there anything I miss out? As I understand the script I only need to put in the password, username and ftp link and after I should get the file. Am I right? Thank you Regards hulkmaster Quote Link to comment https://forums.phpfreaks.com/topic/305766-php-proxy-script-download-via-ftp/ Share on other sites More sharing options...
requinix Posted November 26, 2017 Share Posted November 26, 2017 If you're having problems with your code then you'll need to post your code. Quote Link to comment https://forums.phpfreaks.com/topic/305766-php-proxy-script-download-via-ftp/#findComment-1554130 Share on other sites More sharing options...
ginerjm Posted November 26, 2017 Share Posted November 26, 2017 Since you don't want to show us the pertinent part of the code you are having difficulty with, why don't you do some debugging? Add some echos to it to show you what is happening at certain points in the script. Make the script help you out by having a conversation with it as you work your way closer to a solution. That's how really difficult problems are diagnosed.And when and if you DO post your code, don't post the entire thing. That is the last thing someone here wants to do - read through hundreds of lines of foreign code. You need to do the prep work and try and pick out certain parts of it that you think are causing the problem and get our opinions on those pieces.AND - please post any code properly using the code tags - such as what the <> icon in the tool bar in this box does for you. Quote Link to comment https://forums.phpfreaks.com/topic/305766-php-proxy-script-download-via-ftp/#findComment-1554137 Share on other sites More sharing options...
hulkmaster Posted November 26, 2017 Author Share Posted November 26, 2017 Thanks for the quick answers. Sorry but I thought the link I posted is enough. The whole code is actually not that big. See below: <?php // If you're experiencing problems you can uncomment the following line so errors will be sent to the file. // ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); // // Enter the FTP (or HTTP) URL of your data file below. $url = "ftp://username:[email protected]/full/path/to/file.csv"; // Fetch the file and echo it readfile($url); So I entered my username, password and the file path. If I try and test it afterwards I do get a file but it is empty. I don't get the full csv file If I enter the url (for testing) in my browser I get the whole file. Just the echoing is somehow not working. Thank you in advance. Regards hulkmaster Quote Link to comment https://forums.phpfreaks.com/topic/305766-php-proxy-script-download-via-ftp/#findComment-1554138 Share on other sites More sharing options...
ginerjm Posted November 26, 2017 Share Posted November 26, 2017 Not familiar how this function is used with an ftp call but one thing you can do is check the number of bytes returned. See the manual for some additional notes on using this too. Quote Link to comment https://forums.phpfreaks.com/topic/305766-php-proxy-script-download-via-ftp/#findComment-1554139 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.