Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by hello_world · Mar 09, 2011 at 06:27 PM · serverfiledownloadbrowserftp

How to Retrieve List of Files on FTP Server

I need to be able to obtain a list of files and/or the file hierarchy on my FTP server from any type of UNITY application (web, Desktop, iPad, etc.) so I can populate my file browser; once I have the addresses I know I can use the WWW class to download them (they will all be plain text files). Does anyone know how to do this?

Thanks!

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Bunny83 · Mar 09, 2011 at 09:58 PM

You should be able to use System.net.sockets even in Webplayer but you need to offer a Socket policy. Unity just says that sockets are restricted in the webplayer and you can't open listen sockets but you should be able to connect to your ftp if you can provide this policy.

I've found this article and the Unity MonoCompatibility page says that FtpWebRequest stuff will work inside the Webplayer. I don't know how Unity will check the crossdomain restrictions when using that classes, but in general I think it should be possible.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image hello_world · Mar 24, 2011 at 04:15 PM 0
Share

Thank you for your suggestion. About FTPWebRequest - it works great on the Desktop and iPad, but it does not work for the Web Player; the error is: "error CS0117: System.Net.WebRequest$$anonymous$$ethods' does not contain a definition for Ftp'"

avatar image Bunny83 · Mar 24, 2011 at 04:54 PM 0
Share

Hmm, that's strange. It looks like Unity removed the definition for webbuilds. Depending on what FTP protocol version you use/want use you could handle the protocol yourself if you have the knowledge and time to create your own FTP client on top of sockets. But if your ftp-server have also a web-server I think it's much easier to create a php script that returns the directory listing as xml, csv, html, or what ever :D

avatar image
0

Answer by cmkbim · Jan 02, 2015 at 05:06 PM

The error you are getting can be resolved with passing the actual string value for the method and in your example of the list you will use NLST. But once you do this you will start getting the crossdomain.xml stuff.

 FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp://xxx.com/www/");
 request.Credentials = new NetworkCredential("user", "password");
 request.Method = "NLST";
Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

1 Person is following this question.

avatar image

Related Questions

Unable to connect to remote server when downloading from FTP 0 Answers

Download binary file from my FTP server 0 Answers

Asset Bundles download at runtime 1 Answer

Always get older version of file when downloading it from server? 1 Answer

Large asset bundle can't decompress 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges