I know that, in python, to start a file with it's associated application that is located on my hard drive I can simply use os.startfile.

However, I want to be able to start a file with it's associated application that is located on an ftp site.

Does anyone know how to do this?

Recommended Answers

Answered by jlm699 320 in a post from

Which is located on the ftp site, the file or the application?

Jump to Post

All 4 Replies

Which is located on the ftp site, the file or the application?

Sorry, that wasn't very clear.

The file on the ftp site would be a pdf or word document or something else.

If it is a .txt file I want the file to open in a text editor. If it is a pdf file I want it to open in adobe. If it is a .doc I want it to open in microsoft word etc etc. Just like os.startfile does for a pdf or word file that is on my hard drive.

I don't have any way of testing this... but have you tried using the full qualifier path? (ie, ftp://myserver/test/dir/file.txt )

Secondly, is it possible for you to simply copy the file locally and then use os.startfile ?

That works! Which is much more than I had before. However, it opens a blank firefox window along with the application.

I don't suppose you know how to prevent that? It's not a big deal, I am just wondering because if I browse in windows explorer to the file on the ftp site and double click it, no firefox window opens.

Thank you anyways...it was much simpler than I thought...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.