chickentendon
chickentendon

Reputation: 5

Checking FTP folder for filenames in HTML

I'm relatively new to HTML/CSS and recently was hired to rework a clients website.

Here is my dilemma: They have an FTP folder that only can contain the same set of images for corresponding browser sizes (320.png, 640.png, 768.png, etc.) What I am trying to do is check the folder for file names and return boolean values for each file that is/isn't in the folder.

Every solution I have come across is in something other than HTML/CSS (Perl, command line, PHP) and I'm beginning to wonder if this can be done with strictly front-end code.

Upvotes: 0

Views: 117

Answers (3)

Gooby
Gooby

Reputation: 70

HTML is Hyper Text Markup Language, it is purely a descriptive language which says how a given piece of text or images should be displayed. PHP seems like your best option, as this is the kind of thing it is often used for, but it isn't front-end code.

Upvotes: 1

Marc Johnston
Marc Johnston

Reputation: 1286

Not really with HTML. You can use javascript to instantiate a WScript.shell object. From there you can get some access to the file system.

var win_app = new ActiveXObject("WScript.shell");

Upvotes: 0

Quentin
Quentin

Reputation: 943515

HTML isn't a programming language, so it can't help.

CSS isn't a programming language, so it can't help.

JavaScript is a programming language, but it can't access the FTP server directly.

Assuming everything in the FTP server that you care about will map onto an HTTP URL then you can use the XMLHttpRequest object to try to request the file and then check the .status property to see if it 200 OK or something else (such as 404 Not Found).

Upvotes: 0

Related Questions