in reply to Re: Previewing With Local Image Links
in thread Previewing With Local Image Links

The file path/name using CGI->upload() is not the path to the file on the client
Isn't it? I think that's exactly what it is. There's a post on the front page right now saying "why am I getting the filepath on the client when using CGI.pm to upload?"

--
Weaselling out of things is important. It's what separates us from the animals ... except the weasel.

Replies are listed 'Best First'.
Re: Re: Re: Previewing With Local Image Links
by moodster (Hermit) on Feb 04, 2002 at 10:37 UTC
    Mea Culpa.

    After actually reading the CGI.pm perldoc I discovered that I was wrong. But only partially wrong. The documentation also mentions that not all browsers send the whole path; some send only the file name. So you can't rely on the path that gets submitted to preview images anyway (well, not in a browser-independent way, that is).

    Cheers,
    -- moodster

      Actually you're right about the file name/path problem. Mac browsers seem only to have the filename, and I don't know how that works, come to think of it.

      Plus, as Mac file paths and names are quite happy to have slashes in them, any script that strips out everything up to the last slash is going to cause errors. Anyone want to look in CGI.pm to see how it does this?

      I've got an idea, how about this:

      • you have your content management system include a frame, to which your users can drag the image in question.
      • Now JavaScript knows the current URL of that frame,
      • You do some kind of smart JavaScript submit to your perl script that will include that URL.
      Happy to help with the JavaScript.

      --

      ($_=
      
      
      '      jjjjjjuuuuuuuuusssssssssttttttttt
             annnnnnoootttttthhhhheeeeeerrrrrr
             pppeeeerrrrrrrrrrrrllllllllllllll
             haaaaccccccckkkkkkkeeeeeeeerrrrrr
      '      )
      
      =~y
             /[a-z]//s
             ;print;