I have downloaded an excel template so I can import data.
When I open the spreadsheet I get the following errors on rows 1 3 4 and 7
Warning: tempnam(): open_basedir restriction in effect. File(C:\WINDOWS\TEMP) is not within the allowed path(s): (c:/dolibarr) in C:\dolibarr\www\dolibarr\htdocs\core\modules\import\import_xlsx.modules.php on line 182
Warning: ZipArchive::open(): Empty string as source in C:\dolibarr\www\dolibarr\htdocs\includes\phpoffice\phpexcel\Classes\PHPExcel\Writer\Excel2007.php on line 239
Warning: ZipArchive::open(): Empty string as source in C:\dolibarr\www\dolibarr\htdocs\includes\phpoffice\phpexcel\Classes\PHPExcel\Writer\Excel2007.php on line 240
Fatal error: Uncaught exception ‘PHPExcel_Writer_Exception’ with message ‘Could not open for writing.’ in C:\dolibarr\www\dolibarr\htdocs\includes\phpoffice\phpexcel\Classes\PHPExcel\Writer\Excel2007.php:241 Stack trace: #0 C:\dolibarr\www\dolibarr\htdocs\core\modules\import\import_xlsx.modules.php(184): PHPExcel_Writer_Excel2007->save(false) #1 C:\dolibarr\www\dolibarr\htdocs\imports\class\import.class.php(217): ImportXlsx->write_footer_example(Object(Translate)) #2 C:\dolibarr\www\dolibarr\htdocs\imports\emptyexample.php(88): Import->build_example_file(‘xlsx’, Array, Array, ‘produit_1’) #3 {main} thrown in C:\dolibarr\www\dolibarr\htdocs\includes\phpoffice\phpexcel\Classes\PHPExcel\Writer\Excel2007.php on line 241
The template is supposed to give me a list of field names and indicate which ones are mandatory.
I am using Chrome in Windows 10.
Thanks for posting. You have posted your issue in the Bugs on develop version so we are led to believe that you are using an unstable version of Dolibarr.
Kindly post (here) your Dolibarr setup environment as suggested in [url]www.dolibarr.org/t/post-guidelines/16873/1 This will greatly help the community in assisting you where possible.
The problem is the php configuration.
The temporary directory needs to by accessible by php.
Check your php.ini
Find the directive upload_tmp_dir: uncomment the line and change its value to a required path. In this example it is “/var/tmp”:
; Temporary directory for HTTP uploaded files (will use system default if not
; specified).
; http://php.net/upload-tmp-dir
upload_tmp_dir = /var/tmp
Additionally for PHP versions 5.5 and greater, find the directive sys_temp_dir: uncomment the line and change its value to a required path. In this example, it is “/var/tmp”:
; Directory where the temporary files should be placed.
; Defaults to the system default (see sys_get_temp_dir)
sys_temp_dir = “/var/tmp”
Click OK to apply the changes.
Now, add the new path (in our example it is “/var/tmp”) to open_basedir of all domains, so that PHP scripts can access this directory. Use this KB article for assistance.
Note: The record to be added to the php.txt file should be: