Page 1 of 1
http file upload
Posted: Wed Oct 08, 2003 5:39 am
by jogen143
hi guys
I want a script to upload files through http and at the same time wants write the file name in to the database.
any help would be much appreciated
thanks in advance
Posted: Wed Oct 08, 2003 5:40 am
by twigletmac
How far have you gotten with the code?
Mac
http file upload
Posted: Wed Oct 08, 2003 5:49 am
by jogen143
i dont have any code at all.
just want to upload some pdf's through http to a folder and let user download by clicking the path
for example
http://www.mysite.com/meterials/course1.pdf
i want to write (meterials/course1.pdf) to the database
thanks
Posted: Wed Oct 08, 2003 6:03 am
by twigletmac
Are you looking for us to write the code for you because that isn't the way we tend to work. There has to be some attempt on your part to find the solution.
For file uploading the best place to start is here:
http://php.net/manual/en/features.file-upload.php
Mac
Posted: Wed Oct 08, 2003 10:53 am
by evilMind
Code: Select all
<?php
require_once('YourCode.php');
if ( is_broken( $yourCode )) {
AskForHelp( 'www.devnetwork.net' );
} else {
AttemptToCreate( 'uploadScript' );
}
?>
There's a start for you

Posted: Wed Oct 08, 2003 10:59 am
by Nay
a follow up to that is:
Code: Select all
<?php
require_once('YourCode.php');
if (is_broken($yourCode)) {
AskForHelp('www.devnetwork.net');
} else {
$tries = /see what you concious have to say;
for($i=0; $i<$tries; $i++) {
AttemptToCreate('uploadScript');
}
}
?>
Basicly, the common rule is - "If you don't try, we don't help you". It's not that we don't want to. It's just that we won't be able to help you
effeciently. Anyhow, just google a tutorial on uploading and renaming files. Do some research on copy() and rename() in the php.net manual.
Good luck,
-Nay
ps: the code me and evilMind wrote are a joke, don't test it out!
