save barcode image in require directory php -
i working on barcode project in php. issue when click test.php, barcode image save in same directory php file directory:
/demo1/demo2/demo3/demo4/file1/file2/file3/barcodeimage.png /demo1/demo2/demo3/demo4/file1/file2/file3/test.php
but need save barcodeimage.png in path:
/demo1/demo2/demo3/demo4/image1/image2/image3/barcodeimage.png
i change directory name convenience
here code:
<?php $codetexttwo = '1234567890.png'; $drawexception = null; try { $color_black = new bcgcolor(0, 0, 0); $color_white = new bcgcolor(255, 255, 255); $code_generated = new $classname(); if (function_exists('basecustomsetup')) { basecustomsetup($code_generated, $default_valuetwo); } if (function_exists('customsetup')) { customsetup($code_generated, $default_valuetwo); } $code_generated->setscale(max(1, min(4, $default_valuetwo['scale']))); $code_generated->setbackgroundcolor($color_white); $code_generated->setforegroundcolor($color_black); if ($default_valuetwo['texttwo'] !== '') { $text = converttext($default_valuetwo['texttwo']); $code_generated->parse($text); } } catch(exception $exception) { $drawexception = $exception; } $filenamebctwo = $codetexttwo.".png"; $drawing = new bcgdrawing($filenamebctwo, $color_white); if($drawexception) { $drawing->drawexception($drawexception); } else { $drawing->setbarcode($code_generated); $drawing->setrotationangle($default_valuetwo['rotation']); $drawing->setdpi($default_valuetwo['dpi'] === 'null' ? null : max(72, min(300, intval($default_valuetwo['dpi'])))); $drawing->draw(); $drawing->finish(); } $drawing->finish($filetypes[$default_valuetwo['filetype']]); ?>
change line:
$filenamebctwo = $codetexttwo.".png";
to this:
$filenamebctwo = '/demo1/demo2/demo3/demo4/image1/image2/image3/' . $codetexttwo.".png";
check folder permission directory also
Comments
Post a Comment