Experts Round Table Network
Navigate
Home
ArticleWiki
Forum
Journal
Search
Newsletter
Links
Tech News
expertsrt.com
Welcome Guest.
Username:
Password:
Remember me
Forgot your password?
Register
how to get images from mysql database path
Welcome,
Guest
. Please
login
or
register
.
November 23, 2008, 06:43:41 AM
11307
Posts in
1250
Topics by
501
Members
Latest Member:
rosaline
Home
Help
Search
Login
Register
Experts Round Table Network
|
Serverside Technology
|
PHP
|
how to get images from mysql database path
« previous
next »
Pages:
[
1
]
Print
Author
Topic: how to get images from mysql database path (Read 273 times)
spotonukraj
Offline
Posts: 5
how to get images from mysql database path
«
on:
February 07, 2008, 03:05:52 PM »
Hi,
I m new to php. i designed form were this are the fields : Name, email, phone No. & photo.
I uploaded this data to database as well, were for imagedata i just save the path in sql
table and image in folder called images on server.
when i fetching all data except image part all text data viewing properly, i m not able to get images the images place look like broken link on html page. I put that header as well
header content (content type images/jpeg) but it not working. I am looking for somone help me out.
Logged
rdivilbiss
Governing Council Member
Offline
Posts: 414
Re: how to get images from mysql database path
«
Reply #1 on:
February 07, 2008, 05:36:47 PM »
Well it is certainly possible to load images into a database as binary objects but it is a complete waste of resources.
If you want the "how to" as a object lesson in what not to do we can provide that, but if you want efficiency, load the images natively to the file system and store only the path/filename in the database.
Easier to maintain and significantly faster, both in terms of development and maintenance, as well as server time to actually present the image to the browser.
Logged
Rod
CrYpTiC_MauleR
Site Builder
Offline
Posts: 489
Re: how to get images from mysql database path
«
Reply #2 on:
February 07, 2008, 10:35:44 PM »
>> header content (content type images/jpeg)
are you putting it as this in your PHP file?
header('Content-Type: image/jpeg');
Remember must be put BEFORE any content is sent to browser, and the MIME type is image/jpeg not image
s
/jpeg, see if that helps. By the way is the page accessible to us? If so can you post the link so we can visit it and see what could be happening in the request?
Logged
[
x
]
Fight
|
www.crypticmauler.com
"You must be
Pages:
[
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
ERT 1.5
-----------------------------
=> Round Table Learning Center
=> Bug reports
-----------------------------
Legacy
-----------------------------
=> The next level
=> History of ERT
-----------------------------
Community Affairs
-----------------------------
=> Introductions
=> Ballot Box
===> Closed Polls
=> Soapbox
=> Propose and Consult
===> Propose and Consult...CLOSED
-----------------------------
Bits and Bytes
-----------------------------
=> Tips, Tricks, Snippets, Tidbits And General Pearls Of Wisdom
-----------------------------
Serverside Technology
-----------------------------
=> PHP
=> ASP
-----------------------------
Webservers
-----------------------------
=> Apache
=> IIS
-----------------------------
Databases
-----------------------------
=> MySQL
=> Access
=> MS SQL Server
-----------------------------
Clientside Technology
-----------------------------
=> HTML
=> CSS
=> Javascript
=> Flash
=> WAP/WML
-----------------------------
Web Technologies
-----------------------------
=> General Web Dev
=> Web Standards
=> XML
=> Online Marketing
-----------------------------
Graphics
-----------------------------
=> Graphics Design and Animation
-----------------------------
Programming
-----------------------------
=> .NET
=> JAVA
=> MS DOS Batch Scripting
=> Mathematics
=> C & C++
=> VB
=> Delphi
=> Algorithm design
-----------------------------
Operating Systems
-----------------------------
=> Windows (General)
=> NT Based (2K, 2K-03, NT, XP, Vista)
=> Open Source (All)
-----------------------------
Hardware
-----------------------------
=> Hardware General
=> Gamers Hardware (Advanced)
-----------------------------
Networking
-----------------------------
=> Home (small)
=> Office (large)
=> Internet
-----------------------------
Security
-----------------------------
=> General Security Issues
-----------------------------
Rants/Opinions/Proposals
-----------------------------
=> Site operation
Powered by SMF 1.1 RC2
|
SMF © 2001-2005, Lewis Media
Joomla Bridge by
JoomlaHacks.com