Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

saving the image path instead of the image itself  RSS feed

 
kermitgarrett
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi..
instead of saving the image file itself id like to save only the path.. but there seems to be a problem with the backslash..
for ex.,
\images\product203.jpg
but when i look at the database it only saved
imagesproduct203.jpg
im using MySQL
-=-= garrett
thanks in advance!!
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The backslash character indicates that there is an escape sequence following it. Something like \n for newline or \a for the bell. You can use the escape sequence for backslash, \\, but I prefer to use Unix style paths with a forward slash. MySQL and Java treat the forward slash like any other character, and the IO classes understand how to convert Unix style paths to Windows style paths.
 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kermitgarrett
Welcome to the Ranch! We don't have many rules around here, but we do have a naming policy. You must have a first and a last name, separated. It doesn't have to be your real name, just a real looking one. Please head over here and make this change.
Thanks!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!