Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Possible to create upload/download form like this?

create an upload/download form



10:06 am on Apr 5, 2011 (gmt 0)

Hey guys,

I have another question for you guys. Can this idea be done? Right now I'm the only one who updates my site due to the fact that it involves updating files ( ie: 9800download.php, 9330download.php, etc) and then having to navigate to the folder these are located in via FTP and then upload them...Well I have a friend who would like to help but its a PITA for him to navigate to find the file to update, download the file to his desktop, edit/update it, then upload it back to the folder to update the content...Is it possible to set up a form where he can select which file he would like to update by checking a check box and then click the download button to than download that file so he can edit them really quick. THEN to be able to click a browse button and locate the file on his PC and again, check a check box for the file he would like to replace (update) or folder to upload it to. Then obviously just hit an upload or update button and the file then is uploaded to the correct folder.

I'm just thinking out loud here to get kind of give an example..

Download :

Upload to (folder):
9780 - will replace/update 9780dowload.php
9800 - will replace/update 9800download.php
9700 - will replace/update 9700 download.php

If this sounds confusing, I apologize..It's 6am here and I've been up for about 31 hours now.
Thanks for the help guys.


10:16 am on Apr 5, 2011 (gmt 0)

WebmasterWorld Senior Member tangor is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

Yes, you can, but you'll want to protect such access with passwords, etc.

If this is someone you trust this sounds more like an FTP access question... which also relies on password/access... and as a secondary, should be limited to only the top level folder where such access takes place (and that is NOT your root folder!)


6:10 pm on Apr 5, 2011 (gmt 0)

5+ Year Member

There could be other potential scenarios here depending on what is in the files and how much of a change is needed.


9:40 pm on Apr 5, 2011 (gmt 0)

The files are just html and php code that allow a user to click a download button to download that file.

All I and my friend have to do to update the file is change the getid= to the new updated file version.


10:51 pm on Apr 5, 2011 (gmt 0)

I may have found a much simpler solution but requires me to change my "get.php file...My current get.php file has the following code :


if (isset($_GET['id']) and is_numeric($_GET['id']) and ($_GET['id'] > 0)) {
$id = $_GET['id'];
$filename = 'UYBB6.0_' . $id . '.exe';
$path = $_SERVER['DOCUMENT_ROOT'] . "/files/os/9800/$filename";
if (is_file($path)) {
header("Content-disposition: attachment; filename=" . $filename);
header('Content-type: application/octet-stream');
else { echo "<p>$filename is not a file!</p>"; }
else { echo "<p>Invalid file request.</p>"; }


So all my files in that '/files/os/9800/' have to have start off with ' UYBB6.0_ ' then the "id"..For example


If I can change the way this get.php works to where it only looks for the ID and no matter what is before the ID, it will still prompt the download. For example, if the file names were :

UYBB6.0.0.526_9800.exe or

no matter what is before the _9800 wont matter cuz the file just uses the ID of 9800 to locate the file and prompt the download. Is that possible to do?


3:31 am on Apr 7, 2011 (gmt 0)

Wanted to bump this hoping to get some responses.


7:32 am on Apr 7, 2011 (gmt 0)

i like this post it's very useful.


4:46 pm on Apr 15, 2011 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

What are the methods by which you arrive at the prefixes?



6:38 pm on Apr 15, 2011 (gmt 0)

Well UYBB is the abbreviation for my site and 6.0.0 are the first three numbers in the file version.


6:43 pm on Apr 15, 2011 (gmt 0)

It would be great if I could just get the code to use the ID with out having to use the rest of the file name as well. I tried making it so the file name would be UYBB6.0_9800.exe and everytime we would upload, we would rename it to that. But then it got to be a hassle cuz then we would have to rename the older file and then rename this newer file. I want to be able to keep the file name UYBB6.0.0.#*$!_9800.exe where the ID just looks at the 9800 and will prompt the download each time, no matter what the file name has before the "9800"

Featured Threads

Hot Threads This Week

Hot Threads This Month