Board index   FAQ   Search  
Register  Login
Board index php forum :: Database mySQL & php coding

Problem with uppolading the pic to Database...

Codes here !

Moderators: macek, egami, gesf

Problem with uppolading the pic to Database...

Postby Chalenger » Tue May 27, 2003 9:15 am

The problrm is that when I'm uploading the pic to database using HTML form with out enctype="multipart/form-data" attribute of the form the pic can't be uploaded.. but if I add multipart/form-data to the HTML form.. the POST variables does not transfered to the php file... What is the problem?... I need the both things work.... Register Globals is turned on in php.ini....... :( Can anybody help me out?
Chalenger
New php-forum User
New php-forum User
 
Posts: 4
Joined: Mon May 26, 2003 4:19 pm

Postby Oleg Butuzov » Wed May 28, 2003 12:38 am

by the first i can say any thing becouthe i did see sourse file...

do you completly sure that POST data isnt transfering???
Oleg Butuzov
Last Samuray
Last Samuray
 
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby Chalenger » Wed May 28, 2003 8:12 am

Pejone : the source file is not needed... the problem is not in php file.. but that the POST datas are transfered if I add enctype="multipart/form-data" to the form tag in HTML... and I have no idea why...???? naybe the problem is in php.ini config or Apach??? Do not know.... Have U any idea?
Chalenger
New php-forum User
New php-forum User
 
Posts: 4
Joined: Mon May 26, 2003 4:19 pm

Postby Redcircle » Wed May 28, 2003 4:09 pm

When you use a <input type="file"> the information is not in $_POST it is in $_FILES

ex
<input type="file" name="upload">

$_FILES contains 3 items in the array

$_FILES['upload']['tmp_name'] is the temporary filename in the tmp dir.
$_FILES['upload']['name'] actual filename on your filesystem.
$_FILES['upload']['type'] the mime type of the file

Hope that is what you are looking for. Like Pejone said it would help to see the code.
User avatar
Redcircle
Moderator
Moderator
 
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Postby Chalenger » Thu May 29, 2003 11:53 am

Thanks Redcircle. Actualy that is not what I was asking :) I know where the files upoload vars are.. But I'm saying that exept the file I'm sending POST vars and a file in a form with attribute enctype="multipart/form-data"... and the POST vars are not sent.. I can not get them from $_POST... it is empty.. :( but if I remove the enctype="multipart/form-data" from the form tag... the vars pransfered ok... So I know that the vars and files should be pransferd.. and I do not know what is the troble... Maybe in php.ini config or Apache config. (The OS is RedHat 7.3, PHP compiled as an Apache module)... If U know what the problrm can be.... pls say me.. :)
Chalenger
New php-forum User
New php-forum User
 
Posts: 4
Joined: Mon May 26, 2003 4:19 pm

Postby Redcircle » Fri May 30, 2003 10:26 am

are you defining a method in your form tag. i.e.

<form name="upload" method="post" enctype="multipart/form-data" action"">


(this is why seeing code is good. If you don't post code I'm forced to ask stupid questions.)
User avatar
Redcircle
Moderator
Moderator
 
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Postby Chalenger » Fri May 30, 2003 11:03 am

Thanks Redcircle That's ok it now.. I've reconfigured the php.ini and restarted Apach.. and it seems to be ok now.. But nevertheless thatks for your's afforts to help me out :)
Chalenger
New php-forum User
New php-forum User
 
Posts: 4
Joined: Mon May 26, 2003 4:19 pm

Postby Redcircle » Fri May 30, 2003 12:12 pm

np... hehe.. I work doing tech support.. a reboot usually does the trick :)
User avatar
Redcircle
Moderator
Moderator
 
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA


Return to mySQL & php coding

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron