10

I wanted to know if this is possible?

I would like to create a cross platform Flash projector and files and than create an ISO from it for the user to download.

Google did not help me much so far...

hbit
  • 959
  • 2
  • 13
  • 33
FFish
  • 10,964
  • 34
  • 95
  • 136
  • 3
    Interesting question. I'd be concerned about the speed of it if you're expecting PHP to package up 600mb of data on the fly when the user requests it. You might be better off having it run as a background process (which would mean it could be in any language). – Spudley Feb 22 '11 at 11:08
  • 8
    To let you know, PHP is an HTML preprocessor, not coffee-machine, nor MIDI-tracker, nor ISO-toolkit. Go figure. – Your Common Sense Feb 22 '11 at 11:10
  • 3
    You are looking for a simple `system("mkisofs -R -J -v -T path/");` wrapper. Albeit writing a class for generating ISO filesystems directly via PHP seems tempting.. – mario Feb 22 '11 at 11:12
  • I realize this can not be done on the fly. I am looking just for something to start the process with a notification email. Animoto.com do this for rendering their videos, after the notification you can download the ISO. This does not have to be in PHP. Any other suggestions welcome. – FFish Feb 22 '11 at 11:21
  • PHP can be used on the command line just fine, so it isn't restricted to HTML pre-processing. see: http://php.net/manual/en/features.commandline.php – leiavoia Jan 18 '16 at 23:21

1 Answers1

9

Of course it is possible to do directly from PHP.

However, as one of the comments to your question states, it's probably going to be easier to call an external binary to do the work for you (Although not all hosts may have mkisofs installed).

If you really must do this from PHP, here's some useful references for you.

ISO 9660 specification (ECMA-119) - This is the file format for "ISO" image files.

PHP pack() and unpack() - These will help you manipulate binary data in PHP.

Once you're familiar with the file structure, you may be able to create some pre-compiled segments, and just patch them at various offsets as well as inserting the payload.

Good luck!

Leigh
  • 12,859
  • 3
  • 39
  • 60
  • Thank you. Any suggestions about the other external binaries? The server is Apache, but that's all I know right now. Cheers – FFish Feb 22 '11 at 11:32
  • 1
    You could try `echo system('which mkisofs');` to see if this command is available to you (assuming a *nix based host), alternatively your best bet is probably to talk to your hosting provider. Milage may vary. – Leigh Feb 22 '11 at 11:40