homepage Welcome to WebmasterWorld Guest from 54.167.75.155
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Possible to create upload/download form like this?
create an upload/download form
brettxw




msg:4292331
 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 :
9780download.php
9800download.php
9700download.php

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.

 

tangor




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

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!)

IntegrityWebDev




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

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

brettxw




msg:4292727
 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.

brettxw




msg:4292762
 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');
readfile($path);
}
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

UYBB6.0_9800.exe
UYBB6.0_9780.exe

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 6.0.0.526_9800.exe

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?

brettxw




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

Wanted to bump this hoping to get some responses.

Fredtoby




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

i like this post it's very useful.

rocknbil




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

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

UYBB6.0.0.526_9800.exe
6.0.0.526_9800.exe

brettxw




msg:4298415
 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.

brettxw




msg:4298423
 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"

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved