How to get list of files in a folder on server?


#1

hey guys im developing an app and wants to get the list of files (their downloading link ) stored in folder on my website server.
how is it possible ?

Hitesh.


#2

the ftp extension offers the RemoteFileNames method to get the filenames of a remote directory

Taifun


#3

thanks . but its paid. not suitable for student like me.


#4

not getting example apk link here

https://puravidaapps.com/ftp.php


#5

the apk file is not available to download
see chapter “Test the functionality of the FTP extension” here https://puravidaapps.com/ftp.php how to test it
Taifun


#6

In a similar situation I wanted to get all the csv files of my server of a particular directory. I did it with php. This php code is at the same directory where i want to get the list.

I can’t paste it so download it csvlist.txt (604 Bytes)
rename it as csvlist.php

that code returns a string with all the csv filenames separated by comma.

By opening this file’s URL by WebViewer component, you get into WebViewer.WebView String the response, after that you can split the response by commas and put it in an array.


#7

You got an example of this?


#8

Hello! I have tried your file but in return I always see a blank page and nothing in WebViewer.WebView String. What can be the reason?
I have used your file as is. May be I need to change something?
For example, in line 23 there is an echo command with the following parameters:
echo 'window.AppInventor.setWebViewString
I thought that may be I should change AppInventor to the name of my app? But I did contrary - I have created an app with the name AppInventor and it doesn’t help.


#9

My app looks like this:
thunk_check_web_file_exists2
and showing me in Label1 just the following text - “Folder1” and on a new line “Folder2”.

However, if in browser on my laptop I use the link and then select - view source code of the page, then for the script in empty folder I see this script:
window.AppInventor.setWebViewString("");
while for the folder with scv file I see this:
window.AppInventor.setWebViewString(“1.csv,”);

So, your script is working, but do not setting up WebViewer.WebView String properly. Any ideas?


#10

Use the extension ExtendWebViewer [Free] Extended Web Viewer Extension
There is a method:
when extendWebViewer1 onLoadingFinish
Over here you get the WebViewString

The window.AppInventor.setWebViewString(""); is a command that JavaScript can send the result to WebViewer (to your app).