Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old February 10th, 2005, 10:09 PM
Registered User
 
Join Date: Feb 2005
Location: Walled Lake, MI, USA.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default problem with uploading blob data to MySQL DB

Hello, I have a very simple routine for inserting blob data (a jpg) into a MySQL database. I have this page deployed on both my local - WINDOWS server, and my production FreeBSD UNIX server. Both of these implementations point at the same production MySQL server. Running the routine from my local server inserts the BLOB with no problems into the DB, however runing the same exact script from the production server produces the following results:

Warning: fopen(C:\test\test.jpg): failed to open stream: No such file or directory in /urs/www/users/millersh/admin/Edit.php on line 25

The strange this is how this works great on my local windows server. Obviously there is a php value or something that needs to be configured on the production (UNIX) server - I have already tried the following:

php_value magic_quotes_gpc "1" and also "On"
php_value upload_max_filesize "10M"
php_value file_uploads "1" and also "On"
php_value upload_tmp_dir "/usr/www/users/millersh/temp/" (this directory has write access on the server)

The windows server PHP info is as follows:
http://sheahome1.no-ip.com/PHPInfo

The UNIX php info is as follows:
http://www.millershea.com/php_info

PLEASE HELP!!!! I thank you kindly in advance.
Reply With Quote
  #2 (permalink)  
Old March 8th, 2005, 05:15 PM
Authorized User
 
Join Date: Jul 2003
Location: , , .
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to merediths
Default

Kyle_shea,

  May a venture a guess ... is your development server also the same box you are testing it from? Here is what I think is going on ... after the file is uploaded you have two variables:

$_FILES['userfile']['name'] <-- original filename
$_FILES['userfile']['tmp_name'] <-- file name on server

 Based on the error you are getting, it looks like you are trying to:

    fopen($_FILES['userfile']['name'] );

instead of

     fopen($_FILES['userfile']['tmp_name'] );

That is why you are showing a Windows-style path on the UNIX server in the error message.
Such a thing would work on the development server if you were testing from a browser on the same box, because

 C:\test\test.jpg

 Would exist on that system. But not from the upload, it would already be there. It has to be, or else you wouldn't have been able to upload it!

Regards,
Meredith Shaebanyan

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem writing listview data to mysql db method Pro VB 6 2 April 10th, 2007 07:17 PM
inserting BLOB into MySQL DB, carriage newline jcsnyder PHP Databases 1 September 8th, 2006 12:51 PM
problem writing listview data to mysql db method Pro VB Databases 0 May 17th, 2006 06:18 AM
Problem inserting blob data/uploading file - MySQL kyle_shea Beginning PHP 2 February 15th, 2005 09:18 AM
I need help with uploading file to mysql DB superdos PHP Databases 2 June 27th, 2004 01:50 AM



All times are GMT -4. The time now is 06:52 AM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.