100 Web Space

Problem Uploading files to Database
Page 1 of 1

Author:  frogmen [ Fri May 11, 2007 10:09 pm ]
Post subject:  Problem Uploading files to Database

Hello, I'm trying to upload some files for my installation of phpbb XS2 forum to my sql database, I already do it once a while ago, but silly me, I don´t remember :oops:

pls any help, thks :lol:


Author:  scragar [ Sat Jul 07, 2007 2:33 am ]
Post subject: 

upload form:
<form id="Upload" action="upload.php" enctype="multipart/form-data" method="post">
<label for="file">File to upload:</label>
<input id="file" type="file" name="file">
<label for="submit">Press to...</label>
<input id="submit" type="submit" name="submit" value="Upload me!">

Upload page:
$errors = array(1 => 'php.ini max file size exceeded',
                2 => 'html form max file size exceeded',
                3 => 'file upload was only partial',
                4 => 'no file was attached');
    or error('the upload form is neaded');
($_FILES[$fieldname]['error'] == 0)
    or error($errors[$_FILES['file']['error']]);
    or error('not an HTTP upload');

*     now we have the file without errors we can      *
*       moveit to a new directory using the               *
*                       move_uploaded_file                     *
*         function, orif you want you could add it        *
*            to a DB if the configs already done.....     *

$my_file = fopen($_FILES['file']['tmp_name'], 'r');
$contents = fread($my_file, filesize($_FILES['file']['tmp_name']));

mysql_query("INSERT INTO DBfiles(id, name, contents)
               ."', '".str_replace("'", "\\"."'", $contents)."');");
if you want more info let me know.

Author:  desta [ Wed Sep 26, 2007 8:22 am ]
Post subject: 

Hello, could you please help me, i'm a very very newbie here.

I made some file with using site builder wysiwyg web builder, and i'm so confuse how to upload it.

could you please help me where should i start.


Author:  james_ [ Wed Sep 26, 2007 10:29 am ]
Post subject: 

You can try to use your File Manager menu, which is very easy to use, or you can try yo upload your files via the FTP protocol.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group