playMaker

Author Topic: List files in server folder  (Read 2527 times)

Plancksize

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 75
List files in server folder
« on: February 04, 2019, 09:51:41 AM »
Hey all,

I posted, not long ago, on the help forums a request for help with getting a list of all files in a remote server folder but it didn't got answers so, i'll try it again in here, that might be the most appropriate place.

Basically, what i'm looking for, is an action that will get a list of all files in a given remote server folder. I found some other ways to achieve what I want from that, but this would give me much more freedom to do it.
(basically I want to retrieve a list of all image files present in a defined folder on my server via internet).

If anyone knows how I could achieve this or can help providing an action for that effect, that would be awesome. ;)

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: List files in server folder
« Reply #1 on: February 04, 2019, 02:21:07 PM »
Hi,
Is this a http server

have a look at the explanation here  and let me know if you are looking for an action to do this?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: List files in server folder
« Reply #2 on: February 05, 2019, 02:10:20 AM »
Hi,

 for this, the best way is to create a proper server backend using php.

you query php to return your the content of a given folder or context, and php will create a json result, that you can parse using the various json actions and tools available on the ecosystem.

 It's by far the most practical, secure, reliable, flexible you can get.

you could try some ftp assets, which will give you this kind of infos: https://assetstore.unity.com/packages/tools/network/file-transfer-server-73518

but I don't think they have playmaker support, maybe they would be ok to provide if you ask? redirect to me if they reply posiitivly on this, I can help out.

 Bye,

 Jean

Plancksize

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 75
Re: List files in server folder
« Reply #3 on: February 05, 2019, 09:53:39 AM »
Hi,
Is this a http server

have a look at the explanation here  and let me know if you are looking for an action to do this?

1 - It is an http server, yes.
2- that's exactly what I'm doing.

I got it to work by having a text file I created with all the file names in the folder.
- I'm downloading it first into a string,
- deconstructing the string to get how many files and file names
- iterate between all the filenames and run it through WebRequest (there is an action for that)

This is working and I do get the new images. My issue here is just that the "text file" that works as an index has to be rebuilt by hand every time a new image is added or one is removed from the server, as the downloads/checks are 100% dependent on it.

My request is based on the how easier it would be to manage if I didn't had to generate such text file every time I change the contents of that folder.


Plancksize

  • Beta Group
  • Junior Playmaker
  • *
  • Posts: 75
Re: List files in server folder
« Reply #4 on: February 05, 2019, 09:55:41 AM »
Hi,

 for this, the best way is to create a proper server backend using php.

you query php to return your the content of a given folder or context, and php will create a json result, that you can parse using the various json actions and tools available on the ecosystem.

 It's by far the most practical, secure, reliable, flexible you can get.

you could try some ftp assets, which will give you this kind of infos: https://assetstore.unity.com/packages/tools/network/file-transfer-server-73518

but I don't think they have playmaker support, maybe they would be ok to provide if you ask? redirect to me if they reply posiitivly on this, I can help out.

 Bye,

 Jean

This sounds like a decent path if a basic listing of the files is not achievable in a more "simple way". Need to dig deep into that topic though, as I don't really know much about it :)