Forum Moderators: coopster
I am having one problem which is that
- I can upload and store image into BLOB field normally on one machine-winXP where installed Apache 2 and php 4.x
- exactly same php code not functioning on the another machine-winXP where running Apache 1.3 and php 4.x
What is problem, can I have help from some one?
When I check the data stored in BLOB field (by means of saving into Desktop using MySQL Control Center) it were always stored 77 bytes of image/jpeg data, and 66 bytes of image/bmp files!
For starters, when you post the file if you
print_r($_FILES);
does it return data in the array?
Lets say you have testimage.php with:
print_r($_FILES);
and a form (don't mind the html):
<form action="testimage.php" enctype="multipart/form-data" method="post">
<input type="hidden" name="MAX_FILE_SIZE" value="300000" />
<dl>
<dt><label for="userfile">Company Image</label></dt>
<dd><input type="file" id="userfile" name="userfile" /></dd>
</dl>
<input type="submit" value="Upload Image" />
</fieldset>
</form>
does it all work?
Exactly I did not checked by print_r($_FILES), but when I try to move uploaded file by function move_uploaded_file() it is works okey!
I checked the data readed as $data = addslashes(fread(fopen(...filename..,... filesize...) through echo $data; and in this case I am getting 111 bytes (real 77 bytes with slashes became 111).
The default translation mode depends on the SAPI and version of PHP that you are using, so you are encouraged to always specify the appropriate flag for portability reasons.