Loading ...
Sorry, an error occurred while loading the content.


Expand Messages
  • Andrea Trasatti
    Il giorno 28/ago/05, alle ore 17:31,
    Message 1 of 1 , Sep 1, 2005
      Il giorno 28/ago/05, alle ore 17:31, <sentto-1310435-15812-1125243061-
      andrea=trasatti.it@...> ha scritto:
      > I have configured kannel for sending wap messages and works fine,
      > but now I have
      > another problem and would like to know if some one could give me a
      > tip or hint for
      > solving the following issue:
      > I am using WAP for sending jpg images, the images are stored out
      > of the DocumentRoot
      > and based on a php session and using the following code I send the
      > image:
      > I send this to the phones: http://mysite.com/content.php?
      > sid=12345678912345678912345678911100
      > where sid is the session_id generated when the phone request a
      > content, and there on the
      > session is stored the path of the image
      > Then content.php has something like this:
      > <?php
      > session_id($_GET['sid']);
      > session_start();
      > $cache = $_SESSION['file'];
      > $imginfo = getimagesize($cache);
      > $content_length = filesize($cache);
      > $mime = $imginfo['mime'];
      > header('Content-Length: '.$content_length);
      > header("Content-Type: $mime");
      > header('Content-Disposition: attachment; filename="'.$cache.'"');
      > readfile($cache);
      > ?>
      > this code works when the images are lower than 10k but I started to
      > notice that when the
      > images are 10k the phone (SonyEricsson T610) just can not download
      > the image what I do
      > in does cases, is to move the images to the DocumenRoot and use the
      > following code:
      > <?php
      > session_id($_GET['sid']);
      > session_start();
      > $file_path = $_SESSION['file'];
      > header("Location: http://mysite.com/storage/images/$file");
      > ?>
      > This code just redirects the phone to the path where the content is
      > inside the
      > Documentroot , and the jpg image can now be downloaded with out any
      > problem, but any
      > other user can now later just copy the URL and fetch the content
      > and that is what i want to
      > avoid.
      > I would like to know if some one can give me an idea of how to
      > secure the content and
      > how could I send images larger than 10k using php functions maybe
      > like readfile for
      > geting the content that is out of the Documentroot.
      > Right now i am trying to figure how to use WML and php readfile(),
      > hoping this could help
      > me.

      Check the mailing list archives, this was asked many times already.
      Try using a URL that looks like a real file, such as:

      Where 12345678675324 is your generated session. d.php will be called
      and you can manage the session and validate the user and so on.

      Andrea Trasatti
      My Blog: http://trasatti.blogspot.com/

      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.