-->
Welcome, Guest
Username: Password: Remember me

TOPIC: Corrupt Excel Import File

Corrupt Excel Import File 1 week 3 days ago #34523

Hello,

In the Import Assistance module any (Products, Third Parties, etc) of the excel import template files I try to download will not open due to the following error:
"Excel cannot open the file 'Example_of_import_file_produit_1.xlsx' because the file format of file extension is not valid. Verify that the file had not been corrupted and that the file extension matches the format of the file"

If I open the file in a text editor I see the following:
<br />
<b>Warning</b>: tempnam(): open_basedir restriction in effect. File(C:\WINDOWS\TEMP) is not within the allowed path(s): (c:/dolibarr) in <b>C:\dolibarr\www\dolibarr\htdocs\core\modules\import\import_xlsx.modules.php</b> on line <b>182</b><br />
<br />
<b>Warning</b>: ZipArchive::open(): Empty string as source in <b>C:\dolibarr\www\dolibarr\htdocs\includes\phpoffice\phpexcel\Classes\PHPExcel\Writer\Excel2007.php</b> on line <b>239</b><br />
<br />
<b>Warning</b>: ZipArchive::open(): Empty string as source in <b>C:\dolibarr\www\dolibarr\htdocs\includes\phpoffice\phpexcel\Classes\PHPExcel\Writer\Excel2007.php</b> on line <b>240</b><br />
<br />
<b>Fatal error</b>: 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 <b>C:\dolibarr\www\dolibarr\htdocs\includes\phpoffice\phpexcel\Classes\PHPExcel\Writer\Excel2007.php</b> on line <b>241</b><br />

This is a fresh installation of Dolibarr.

The CSV template downloads and opens fine.

Thanks in advance.
The administrator has disabled public write access.

Corrupt Excel Import File 1 week 2 days ago #34527

  • aljawaid
  • aljawaid's Avatar
  • OFFLINE
  • Moderator
  • Trying to make the source open.
  • Posts: 568
  • Thank you received: 78
  • Karma: 9
Hello

Thanks for posting. You have posted your issue in the Bugs on a stable version section.

Kindly post (here) your Dolibarr setup environment as suggested in https://www.dolibarr.org/forum/2-this-forum/28209-post-guidelines. This will greatly help the community in assisting you where possible.
The administrator has disabled public write access.

Corrupt Excel Import File 1 week 2 days ago #34540


DOLIBARR ENVIRONMENT
- Version: 8.0.1
- Operating System: Microsoft Windows 10 Pro for Workstations
- Web Server: Apache/2.4.9 (Win32)
- PHP: PHP 5.5.12
- Database: MySQL 5.0.45
- URL(s): http://dolibarr/dolibarr/imports/emptyexample.php?format=xlsx&datatoimport=adherent_1&excludefirstline=1&separator=%2C&enclosure=%22
The administrator has disabled public write access.

Corrupt Excel Import File 1 week 2 days ago #34529

  • 8clicks
  • 8clicks's Avatar
  • OFFLINE
  • Junior
  • Posts: 39
  • Thank you received: 6
  • Karma: 2
Hi,
you can check your read/write permission for the file. Make sure it's enable for read/write

C:\dolibarr\www\dolibarr\htdocs\includes\phpoffice\phpexcel\Classes\PHPExcel\Writer\Excel2007.php
The administrator has disabled public write access.

Corrupt Excel Import File 1 week 2 days ago #34541

8clicks wrote:
Hi,
you can check your read/write permission for the file. Make sure it's enable for read/write

C:\dolibarr\www\dolibarr\htdocs\includes\phpoffice\phpexcel\Classes\PHPExcel\Writer\Excel2007.php

Thank you for the suggestion. The file was originally set to read only. But changing to read / write has not resolved the issue.
The administrator has disabled public write access.

Corrupt Excel Import File 1 week 1 day ago #34545

  • ksar
  • ksar's Avatar
  • OFFLINE
  • Junior
  • Posts: 37
  • Thank you received: 16
  • Karma: 2
Hi,

The problem is for the import, your serveur php need to create a temporary file.
He tries to do it but your configuration does not allow to create a file in that folder : open_basedir restriction in effect. File(C:\WINDOWS\TEMP)

Need to check the php configuration.
The administrator has disabled public write access.
Time to create page: 0.082 seconds