7
$\begingroup$

I would like to Import files from an FTP site. The code below works on a test site:

file = Import["ftp://test:[email protected]/pigs.xml"];

But when I try to Import from a commercial site using similar code:

file = Import["ftp://user:[email protected]/fldr/fname.csv"]

I get "FetchURL::conopen: The connection to URL [address above] cannot be opened. If the URL is correct, you might need to configure your firewall program, or you might need to set a proxy in the Internet connectivity tab of the Preferences dialog (or by calling SetInternetProxy). For HTTPS connections, you might need to inspect the authenticity of the server's SSL certificate and choose to accept it."

If I paste the same ftp string into a browser it loads the file I want. What's wrong here?

@halirutan-I think I am using the correct user name and password.
@J.M.-I'm using Win7.
@celtschi-I saw a the back slash too at some point. I think I deleted it to get the browser to work; don't remember clearly.
@all-Thanks for all this effort. I'm trying to digest this feedback.
@all-Tried again with various combinations of Element specifications with no success.
Also attempted to get a file list with no success.

$\endgroup$
9
  • $\begingroup$ But you used the correct user and pwrd in the second example? You tried it in your browser after you deleted the cache with stored data and passwords? Can you maybe give an example with a real user and passwd combination which we may try here? $\endgroup$
    – halirutan
    Sep 17, 2012 at 2:14
  • $\begingroup$ I just tried it with a file on my website and it worked. Is it possible, that it has something to do with this special website of yours? $\endgroup$
    – halirutan
    Sep 17, 2012 at 2:20
  • 3
    $\begingroup$ What OS are you using? I get similar errors in Ubuntu Oneiric when trying to retrieve ExampleData[], e.g. ExampleData[{"Matrix", "WEST0479"}], since ExampleData[] seems to try to import things via FTP from the Matrix Market. $\endgroup$ Sep 17, 2012 at 2:38
  • $\begingroup$ @J.M. I have the same behavior on my Ubuntu 64 and MacOSX. $\endgroup$
    – halirutan
    Sep 17, 2012 at 10:35
  • 1
    $\begingroup$ @J.M. Your pasted filename string still has one (or more) non-displayable chars in there. The last 8 bytes I see are 00000047h: 3F 3F 6D 74 78 2E 67 7A, but you may get another thing instead of those 3F 3F $\endgroup$ Sep 17, 2012 at 11:56

1 Answer 1

4
$\begingroup$

Here is the solution that worked for with the west0479.mtx example. I had the same behavior as pointed out in the comments which means both, ExampleData[{"Matrix", "WEST0479"}] and

Import["ftp://math.nist.gov/pub/MatrixMarket2/Harwell-Boeing/chemwest/west0479.mtx.gz"]

timed out with a FetchURL::conopen message.

Since my internet connectivity was fine (Edit->Preferences->Internet Connectivity->Test Internet Connectivity) I did a clean start of Mathematica. Here in Linux this goes by starting Mathematica from the console with -cleanstart option.

Import["ftp://math.nist.gov/pub/MatrixMarket2/Harwell-Boeing/chemwest/west0479.mtx.gz", 
 "Graphics"]

Mathematica graphics

All credits for this go to the Wolfram support.

$\endgroup$
1
  • $\begingroup$ I can confirm this worked in a fresh session (without needing a "clean start") under Mac OS x 10.8 $\endgroup$
    – Verbeia
    Sep 24, 2012 at 11:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.