Boolean Island !

Upload File to the Server

Posted by: ranacse05 on: February 23, 2008

Hello everybody here is a upload script by php.using this script u can upload file in the server.This is not that tough script.But for beginners its important.:)

index.php file

[FORM ENCTYPE="multipart/form-data" ACTION="uploadck.php" METHOD=POST]
Upload this file: [INPUT NAME="file_up" TYPE="file][INPUT TYPE="submit" VALUE="Send File [/FORM]

uploader.php

$file_upload=”true”;
echo $_FILES[file_up][name];
$file_name=$_FILES[file_up][name];
$add=”upload/$file_name”; // the path with the file name where the file will be stored, upload is the directory name.
if(move_uploaded_file ($_FILES[file_up][tmp_name], $add)){
// do your coding here to give a thanks message or any other thing.
}
else{echo “Failed to upload file Contact Site admin to fix the problem”;}

7 Responses to "Upload File to the Server"

your page is very helpful. anyone can get help from u r site. thanks for this kind of site.
bye

i’m newbie, how i write that script to my wordpress.
thanx

@fosilt
Actually what u wanna do ? If u wanna change ur WP theme uploading the files then u have to pay WP for that.

no, i just wanna to upload my php script, not WP theme?
so?
thanx

@fosilt
Please contact with WP team about it.I donno :(

i tried program but it shows following error
Fatal error: Uncaught exception ‘Zend_File_Transfer_Exception’ with message ‘”doc_path” not found by file transfer adapter’ in C:\wamp\www\jplnews\library\Zend\File\Transfer\Adapter\Abstract.php:1254 Stack trace: #0 C:\wamp\www\jplnews\library\Zend\File\Transfer\Adapter\Abstract.php(572): Zend_File_Transfer_Adapter_Abstract->_getFiles(‘doc_path’) #1 C:\wamp\www\jplnews\library\Zend\Form\Element\File.php(435): Zend_File_Transfer_Adapter_Abstract->isValid(‘doc_path’) #2 C:\wamp\www\jplnews\library\Zend\Form.php(1985): Zend_Form_Element_File->isValid(NULL, Array) #3 C:\wamp\www\jplnews\application\default\controllers\ForController.php(22): Zend_Form->isValid(Array) #4 C:\wamp\www\jplnews\library\Zend\Controller\Action.php(503): ForController->indexAction() #5 C:\wamp\www\jplnews\library\Zend\Controller\Dispatcher\Standard.php(285): Zend_Controller_Action->dispatch(‘indexAction’) #6 C:\wamp\www\jplnews\library\Zend\Controller\Front.php(934): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), O in C:\wamp\www\jplnews\library\Zend\File\Transfer\Adapter\Abstract.php on line 1254

then plz what can i do?

how to upload file in cakephp1.2

Leave a Reply

My blog worth


My site is worth $3431.
How much is yours worth?

My Twittes

FireFox

Firefox 3

My Facebook

this is Raquibul's profile

View Raquibul Islam's profile on LinkedIn

My fav

 

February 2008
S M T W T F S
« Jan   Mar »
 12
3456789
10111213141516
17181920212223
242526272829  

Flickr Photos

Moon !

Moon !

Leevio

Leevio

Leevio

Tea !

History

me

More Photos

My Bookmarks

Dynamic Malloc

Blog Stats

  • 46,705 hits