Professional Web Applications Themes

backslash - ASP

Hi I created a table with varchar field where i want to store the path of an image. I will then use this file to retrieve this image on my browser. Everything goes fine when i use a simple html command as : <img src="C:\Inetpub\wwwroot\MyWeb\images\one.jpg" height="200" width="200"> this is a hard-coded path. Hence no problem. But when I store in the database path value: insert into story_table values (1, 'Language', 'C:\Inetpub\wwwroot\MyWeb\images\one.jpg', 'C:\Inetpub\wwwroot\MyWeb\images\two.jpg', 'C:\Inetpub\wwwroot\MyWeb\images\three.jpg', 'C:\Inetpub\wwwroot\MyWeb\images\four.jpg', 'variation','cu lture', 'tamil','chinese','english','german','hindi','maly alam','si nglish','urdu'); '\' is not stored????????? why is this so ? hwo can i store the complete using backslah. Currently it is storign ...

  1. #1

    Default backslash

    Hi

    I created a table with varchar field where i want to store
    the path of an image.

    I will then use this file to retrieve this image on my
    browser. Everything goes fine when i use a simple html
    command as :
    <img src="C:\Inetpub\wwwroot\MyWeb\images\one.jpg"
    height="200" width="200">

    this is a hard-coded path. Hence no problem.

    But when I store in the database path value:

    insert into story_table values
    (1, 'Language', 'C:\Inetpub\wwwroot\MyWeb\images\one.jpg',
    'C:\Inetpub\wwwroot\MyWeb\images\two.jpg',
    'C:\Inetpub\wwwroot\MyWeb\images\three.jpg',
    'C:\Inetpub\wwwroot\MyWeb\images\four.jpg', 'variation','cu
    lture',
    'tamil','chinese','english','german','hindi','maly alam','si
    nglish','urdu');

    '\' is not stored????????? why is this so ? hwo can i
    store the complete using backslah. Currently it is storign
    as:
    C:InetpubwwwrootMyWebimagesone.jpg
    instead of:
    C:\Inetpub\wwwroot\MyWeb\images\one.jpg

    any idea why is this happening?

    thanks
    janet!


    janet Guest

  2. #2

    Default Re: backslash

    Hi Janet

    Try replacing the backslash character with its unicode equivalent which is
    UNICODE(5C). I think the datatype of your field might need to be nvarchar to
    use unicode. I have never done that myself so I don't know if it works...

    Alternatively, if all of your images are stored in the same folder could you
    not just store the image name and perhaps use relative url in your code?

    Hope this helps


    Graham

    "janet" <knowgrouphotmail.com> wrote in message
    news:0a8b01c36890$513939b0$a301280aphx.gbl...
    > Hi
    >
    > I created a table with varchar field where i want to store
    > the path of an image.
    >
    > I will then use this file to retrieve this image on my
    > browser. Everything goes fine when i use a simple html
    > command as :
    > <img src="C:\Inetpub\wwwroot\MyWeb\images\one.jpg"
    > height="200" width="200">
    >
    > this is a hard-coded path. Hence no problem.
    >
    > But when I store in the database path value:
    >
    > insert into story_table values
    > (1, 'Language', 'C:\Inetpub\wwwroot\MyWeb\images\one.jpg',
    > 'C:\Inetpub\wwwroot\MyWeb\images\two.jpg',
    > 'C:\Inetpub\wwwroot\MyWeb\images\three.jpg',
    > 'C:\Inetpub\wwwroot\MyWeb\images\four.jpg', 'variation','cu
    > lture',
    > 'tamil','chinese','english','german','hindi','maly alam','si
    > nglish','urdu');
    >
    > '\' is not stored????????? why is this so ? hwo can i
    > store the complete using backslah. Currently it is storign
    > as:
    > C:InetpubwwwrootMyWebimagesone.jpg
    > instead of:
    > C:\Inetpub\wwwroot\MyWeb\images\one.jpg
    >
    > any idea why is this happening?
    >
    > thanks
    > janet!
    >
    >

    Graham Guest

Similar Threads

  1. Backslash issue
    By Berry B in forum PHP Development
    Replies: 1
    Last Post: February 19th, 07:41 PM
  2. Text box value, backslash, and PHP variable
    By John in forum PHP Development
    Replies: 2
    Last Post: November 27th, 09:03 AM
  3. Backslash substitution question
    By Ron Coutts in forum Ruby
    Replies: 6
    Last Post: November 11th, 10:46 PM
  4. Trailing backslash on URL problem
    By Lee in forum PHP Development
    Replies: 1
    Last Post: October 2nd, 12:28 AM
  5. Replies: 1
    Last Post: September 17th, 02:56 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139