Jump to content

Need help - using php to check if file exists and then get it


Recommended Posts

I want to create a download page for files in a folder in the web directory.

 

So for example if the folder is named Files, and there are some files in it, i need a php script that will search in that folder for any existing files, and if they exist, then it will generate a table for each item so users can download it.

 

I know this is possible as i have seen something similar with an image gallery that searches a folder and outputs thumbnails, but i need it for files.

 

The directory is http://arpwn.com/etmain/

and the .pk3 files are maps for a game.

 

And also the php would update the downloads page every time a new file is uploaded, or at least checked a couple times a week.

 

I can do the styles myself, i just dont know how to check and get the files from the folder using php.

I think you just want the file_exists function to check if it exists.

 

To get it, depending on how you want it, file for an array or file_get_contents

 

I would play around with that and check back if you have any problems.

 

If you want this done for you, post in the freelance section.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.