Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

problem loading ipx files

by Anonymous Monk
on Dec 16, 2004 at 22:24 UTC ( [id://415494]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Thanks in advance for any help. I am trying to display a virtual tour online that uses an ipix file. If I upload the ipix file to the server and hard code this in the html file it works fine:
param name="URL" value="hawaii_trip.ipx"
I want to be able to store the files in a mysql database and display them like:
param name="URL" value="show_ipx.pl?id=50" #which prints out the mime type followed by the raw data
I'm getting an error: Failed to load image
Thanks

Replies are listed 'Best First'.
Re: problem loading ipx files
by lithron (Chaplain) on Dec 16, 2004 at 22:55 UTC
    It would be much easier to answer this question if the code to show_ipx.pl was posted (minus the login information for your database server).

    My guess is that show_ipx.pl needs to send a different HTTP Content header. You'll have to find out what type of content a IPIX file is, and send that instead of text/html or whatever you're sending now.
Re: problem loading ipx files
by Anonymous Monk on Dec 16, 2004 at 23:12 UTC
    Sorry I didn't include more details. Here is the bulk of show_ipx.pl:
    my $sth = $dbh->prepare(qq(SELECT tripdata, tripmimetype FROM vacation +_files WHERE id=?)); $sth->execute($id); $sth->bind_columns(\$tripdata, \$tripmimetype); $sth->fetch(); $sth->finish(); $dbh->disconnect; $tripmimetype = ($tripmimetype eq "application/octet-stream") ? 'appli +cation/x-ipix' : $tripmimetype; print "Content-type: $tripmimetype\n"; print $tripdata; exit;
    I checked and is printing out the correct mime type.
    When I insert it into the database it gets the mime type of application/octet-stream for some reason.
    Thats why I'm changing it when pulling it back out.

    Thanks again
      print "Content-type: $tripmimetype\n";
      A CGI Header needs to end with two newlines (not one). This could be your problem. Can you open your show_ipx.pl in a browser? It should display a download dialog or something like that. Or does it show an error? If so, can you check the web server error log? If the second \n is missing you would see an "incomplete headers" message.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://415494]
Approved by sgifford
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (1)
As of 2024-04-25 04:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found