darbyshire Posted May 18, 2009 Posted May 18, 2009 i gave been given the task of creating a website for someone. The asked for someway to upload a file on the website. Is there any way to do this and also show uploaded files on the page? Thanks Peter
powdarrmonkey Posted May 18, 2009 Posted May 18, 2009 If you've got script permissions, probably something like ...:::: PHP File Manager
darbyshire Posted May 18, 2009 Author Posted May 18, 2009 i was looking at something simple like a browse box and a submit button. and a list of files/folder for them to browse. Thanks Peter
powdarrmonkey Posted May 18, 2009 Posted May 18, 2009 You'll probably have to write your own, I don't know of anything that specific off the shelf.
mossj Posted May 18, 2009 Posted May 18, 2009 i was looking at something simple like a browse box and a submit button. and a list of files/folder for them to browse. Thanks Peter take a look at W3Schools Online Web Tutorials in the php section, in particular (from the first paragraph) this article http://www.w3schools.com/php/php_file_upload.asp
darbyshire Posted May 18, 2009 Author Posted May 18, 2009 tried the post by mossj did everything it asked and getting "No such file or directory in E:\domains\k\kingsbridgecluster.co.uk\user\htdocs\upload_file.php on line 25" anyone know? Thanks Peter
dwhyte85 Posted May 18, 2009 Posted May 18, 2009 If you want to go the FTP route: PHP: ftp_connect - Manual FTP_CONNECT() & FTP_PUT() $file = 'somefile.txt'; $remote_file = 'readme.txt'; // set up basic connection $conn_id = ftp_connect($ftp_server); // login with username and password $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); // upload a file if (ftp_put($conn_id, $remote_file, $file, FTP_ASCII)) { echo "successfully uploaded $file\n"; } else { echo "There was a problem while uploading $file\n"; } // close the connection ftp_close($conn_id); ?> Put your form within here and do it this way (if it has to be FTP). 1
Michael Posted May 18, 2009 Posted May 18, 2009 If you want a very basic FTP application, explorer has a built in FTP client. You could create a shortcut and it would literally be "drag and drop" into the folder. 1
mossj Posted May 18, 2009 Posted May 18, 2009 or you could use WebDav which would work in a simular way to ftp folders 1
darbyshire Posted May 19, 2009 Author Posted May 19, 2009 thanks guys i will have a look at these now. Peter
darbyshire Posted May 19, 2009 Author Posted May 19, 2009 If you want a very basic FTP application, explorer has a built in FTP client. You could create a shortcut and it would literally be "drag and drop" into the folder. I have got a link to the ftp server which is hosted by an external company. when i click the link it comes up with the username and password. i only have one to access it. Would there by anyway of making a new username and password for the users (prob only need one) or will i have to ring the company? Thanks Peter
rush_tech Posted May 19, 2009 Posted May 19, 2009 I have got a link to the ftp server which is hosted by an external company. when i click the link it comes up with the username and password. i only have one to access it. Would there by anyway of making a new username and password for the users (prob only need one) or will i have to ring the company? Thanks Peter Yes, just ask you host to reset your password.
apoth0r Posted May 19, 2009 Posted May 19, 2009 or if your host has a cpanel, create yourself a new FTP account with access to what needs accessing. Saves on "accidents" later ( myurl .com/cpanel)
darbyshire Posted May 19, 2009 Author Posted May 19, 2009 nah doesnt have a cpanel. I was just given this to carry on with. All i need is a folder /ftp server/uploads to be able to have access by people so they can put documents on, view them but not delete. But when i come to change permission it is saying i dont have permission to do so. -_-! Peter
srochford Posted May 19, 2009 Posted May 19, 2009 The other thing you need to be really careful with is checking who can get to this page to upload - if it's open to the world then the world will use it. In no time at all, you'll find your ftp space full of "warez" or just a denial of service attack mounted against you!
darbyshire Posted May 19, 2009 Author Posted May 19, 2009 just rang the comapny up and they said it isnt possible to do what i want. Know i have to buy a web server and link the current web address to it. How can i do this? Been told i have to contact the council to allow it.
Michael Posted May 19, 2009 Posted May 19, 2009 Any good hosting provider should allow you to create multiple FTP accounts. If you have to contact the council, it's probably just another silly lengthy procedure for a 2 minute job. Alternatively you could go with a real hosting provider if the funds are available.
Arthur Posted May 19, 2009 Posted May 19, 2009 (edited) Would the Dropbox Uploader PHP script be an option? Instead of uploading files via FTP, it uploads directly to a Dropbox account (which gives you 2GB of space for free). Edited May 19, 2009 by Arthur
tom_newton Posted May 19, 2009 Posted May 19, 2009 What are the files? What are you actually trying to achieve? There may be easier ways to do this (and safer) - for example, uploading the files to a 3rd party service (eg. flickr if they are images only) and hotlinking them. There's also the option of picking up some cheap webspace and then linking people to that yourself - this way you don't move the main site/domain, and any issues/compromises on the file hosting would be contained. Otherwise "file upload" forms will work if you have the requisite permissions - but these are dangerous tools in inexperienced hands.
mossj Posted May 19, 2009 Posted May 19, 2009 (edited) or you could use joomla to create the site (you can pick up free templates, and its easy to install (even easier if your new host offers up to date one click installers))then you can upload the files using remository or docman. Here is an example of a site using remository that allows users to upload files Ashlawn School - Useful Downloads Edited May 19, 2009 by mossj
SteveBentley Posted May 22, 2009 Posted May 22, 2009 I think the FTP part of the question is a red herring - a file upload PHP/ASP script would let you accept the files and drop them onto the server via HTTP and the server's file system. Security is a major concern though as has been pointed out. At the very minimum you'd want to limit it to specific file extensions and a file size limit. And then be very careful how you use the files!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now