-4

I'm using denwer as my wamp-server, o have code, that exports graphics, but on my drive I have little free space, and i want to save this files for example to the D: drive.

How would I do this?

Also here is part of my code:

while($row = odbc_fetch_array($data))
    { 

         //if($row['GRD_ID'] != "") {
            /* $file_name_jp2 = "TI/" . $table_name . "/" . $row['GRD_ID'] . ".jp2";
             $file = fopen ($file_name_jp2, "w");
             fputs($file, $row['GRD_GRAPHIC']);
             fclose($file);
*/

            $file_name_jpg = "TI/" . $table_name . "/" . $row['GRD_ID'] . ".jp2";
            $file_out_jpg  = str_replace('.jp2', '.jpg', $file_name_jpg);

            file_put_contents($file_name_jpg, $row['GRD_GRAPHIC']);

            // execute imagemagick convert to change to jpeg with quality 40
            exec("/usr/local/ImageMagick/convert $file_name_jpg -quality 20 -format jpg $file_out_jpg");
            unlink($file_name_jpg); // get rid of temp jp2 file


             set_time_limit(0);
             unset($row);
             $l++;
         //}
         $k++;
    }

See $file_name_jpg

Mike Mackintosh
  • 13,917
  • 6
  • 60
  • 87
byCoder
  • 3,462
  • 6
  • 28
  • 49
  • It is extremely unclear what, exactly, you need help doing, Pavel. – Matt Aug 06 '12 at 15:52
  • @Matt for example, my wamp is on C:drive, and php script exports file to it's directory on C:, but how to do saving on D: ? – byCoder Aug 06 '12 at 18:58

1 Answers1

0

Well, first off, that code is written for *nix. It wont work on a Windows machine as is.

You will need to update the path of the convert executable, to be that of you Windows path, and change $file_name_jpg:

$file_name_jpg = "D:/TI/" . $table_name . "/" . $row['GRD_ID'] . ".jp2";

Assuming you have a folder TI on your D: drive, and all other nested folders under TI

Mike Mackintosh
  • 13,917
  • 6
  • 60
  • 87
  • The issue may then be that your denwer install doesnt have privileges to your Windows drives. Try to mount, or do mount to see which drives are already mounted. – Mike Mackintosh Aug 06 '12 at 17:08