file reference "\n" characters interpreted as carriage return

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • snaeher
    New Member
    • Jun 2007
    • 4

    file reference "\n" characters interpreted as carriage return

    Is there a method I can use so functions don't interpret "\n" as a carriage return in file references?

    EXAMPLE

    Function call:
    imagecreatefrom jpeg("C:\Docume nts and Settings\nxxxx\ Desktop\button. jpg");

    Results:
    Warning: imagecreatefrom jpeg(C:\Documen ts and Settings xxxx\Desktop\bu tton.jpg): failed to open stream: No such file or directory
  • snaeher
    New Member
    • Jun 2007
    • 4

    #2
    Format file references using:
    addcslashes($fi leref, "\n\r")

    Originally posted by snaeher
    Is there a method I can use so functions don't interpret "\n" as a carriage return in file references?

    EXAMPLE

    Function call:
    imagecreatefrom jpeg("C:\Docume nts and Settings\nxxxx\ Desktop\button. jpg");

    Results:
    Warning: imagecreatefrom jpeg(C:\Documen ts and Settings xxxx\Desktop\bu tton.jpg): failed to open stream: No such file or directory

    Comment

    • pbmods
      Recognized Expert Expert
      • Apr 2007
      • 5821

      #3
      Heya, snaeher.

      You might find escapeshellarg( ) useful.

      Comment

      Working...