Congratulations to AcaCandy on her 100,000th post!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen blue screen boot bsod computer connection crash css dell driver drivers email error ethernet excel firefox firefox 3 game hard drive internet internet explorer itunes laptop linux malware monitor network networking nvidia outlook outlook 2003 outlook 2007 outlook express partition problem router slow software sound trojan usb video virus vista wifi windows windows vista windows xp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Solved: Upload file to 2 separate folders on server


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
aconite's Avatar
Senior Member with 172 posts.
 
Join Date: Feb 2006
Experience: Intermediate
17-May-2008, 07:54 PM #1
Solved: Upload file to 2 separate folders on server
hi,

I have a client who wants the following on their website:
1. To upload a file to the relevant folders on the server eg there are 2 folders on the server -
folder A - spreadsheet folder
folder B - data analysis folder
when the client uploads a tax.xls file, we would want it to go to the spreadsheet folder
and when the client uploads a data file, we would want it to go to the data analysis
folder. Can this be done?
I have looked in hotscripts & other scripts website but can't seem to find what I am
looking for.
I don't have much programming skills, so would need something that is not too difficult

2. The client doesn't want every tom, dick or harry to upload stuff onto the web server and
crash it so what would be the best way to implement question 1

Any help appreciated

thanks
TheRobatron's Avatar
Computer Specs
Senior Member with 457 posts.
 
Join Date: Oct 2007
Location: England
Experience: Intermediate
30-May-2008, 05:13 AM #2
You could either use direct FTP access, which can easily be password protected or a password protected upload script. You could do this by using .htaccess protection, or validating the password in PHP (or some other server side language). Then, using the HTML input type='file' you can upload a file to a set directory.
__________________
There's no place like 127.0.0.1

tomdkat's Avatar
Computer Specs
Distinguished Member with 3,705 posts.
 
Join Date: May 2006
Location: S.F. Bay Area, CA
Experience: Intermediate
30-May-2008, 01:25 PM #3
Quote:
Originally Posted by TheRobatron View Post
Then, using the HTML input type='file' you can upload a file to a set directory.
How?

Peace...
TheRobatron's Avatar
Computer Specs
Senior Member with 457 posts.
 
Join Date: Oct 2007
Location: England
Experience: Intermediate
31-May-2008, 05:30 AM #4
Well a simple HTML & PHP upload script would look a bit like this:

HTML Code:
<form method='post' action='processform.php' enctype='multipart/form data' /> <input type='file' name='somefile' /> <input type='submit' /> </form>
processform.php:
PHP Code:
$target_path "uploads/";
$target_path $target_path basename$_FILES['somefile']['name']); 
move_uploaded_file($_FILES['somefile']['tmp_name'], $target_path); 
tomdkat's Avatar
Computer Specs
Distinguished Member with 3,705 posts.
 
Join Date: May 2006
Location: S.F. Bay Area, CA
Experience: Intermediate
31-May-2008, 10:53 AM #5
Gotcha. I thought you implied there was something inherent to using an input type of "file" that would support specification of where to store a particular file.

Peace...
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 01:06 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.