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
Printable View
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
If you've got script permissions, probably something like ...:::: PHP File Manager
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
You'll probably have to write your own, I don't know of anything that specific off the shelf.
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
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
If you want to go the FTP route:
PHP: ftp_connect - Manual
FTP_CONNECT()
&
FTP_PUT()
Put your form within here and do it this way (if it has to be FTP).PHP Code:<?php
$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);
?>
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.
or you could use WebDav which would work in a simular way to ftp folders
thanks guys i will have a look at these now.
Peter
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
or if your host has a cpanel, create yourself a new FTP account with access to what needs accessing. Saves on "accidents" later :D
( myurl .com/cpanel)
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
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!