Jump to content

PHP Proxy Script - Download via FTP


hulkmaster

Recommended Posts

Hi,

 

I am quite new to programming and would need some help please. Getting crazy here  :happy-04:

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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:password@hostname.com/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

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.