Page 1 of 1

Cannot upload CSV

Posted: Mon Dec 16, 2019 1:59 am
by mfaisel
Hi,

I am using a multi-file upload. When I upload a CSV file, the following error occurs

Image

As a temporary solution, I changed the file extension from .csv to .txt

How do I fix this issue permanently?

Re: Cannot upload CSV

Posted: Mon Dec 16, 2019 11:37 am
by dan123dan
Hi,

Make sure that you allow the CVS extension on your dynaform.

Because if a file with a different extension is attached, a validation error message is shown.

To more information about this, check the wiki, https://wiki.processmaker.com/3.1/Multi ... Extensions

let me know if everything is OK.

Re: Cannot upload CSV

Posted: Mon Dec 16, 2019 1:20 pm
by programerboy
Hi,
You are not allowed to upload a file by changing the format for security reasons (For example change csv to txt)
To fix your problem, set the following settings in the env.ini file:
Code: Select all
enable_blacklist = 1
files_white_list = 'docx, xlsx, doc, xls, jpeg, jpg, png, pdf, zip, csv, txt'
The path of this file is :
\opt\processmaker\workflow\engine\config\env.ini

https://www.youtube.com/channel/UCYiyz1 ... 1iw/videos
Thanks

Re: Cannot upload CSV

Posted: Mon Dec 16, 2019 10:24 pm
by mfaisel
dan123dan wrote: Mon Dec 16, 2019 11:37 am Hi,

Make sure that you allow the CVS extension on your dynaform.

Because if a file with a different extension is attached, a validation error message is shown.

To more information about this, check the wiki, https://wiki.processmaker.com/3.1/Multi ... Extensions

let me know if everything is OK.
Thank you for the advice.

However, the recommended steps do not fix the problem. I am still getting the same error message.

Thanks again.

Re: Cannot upload CSV

Posted: Mon Dec 16, 2019 10:56 pm
by mfaisel
programerboy wrote: Mon Dec 16, 2019 1:20 pm Hi,
You are not allowed to upload a file by changing the format for security reasons (For example change csv to txt)
To fix your problem, set the following settings in the env.ini file:
Code: Select all
enable_blacklist = 1
files_white_list = 'docx, xlsx, doc, xls, jpeg, jpg, png, pdf, zip, csv, txt'
The path of this file is :
\opt\processmaker\workflow\engine\config\env.ini

https://www.youtube.com/channel/UCYiyz1 ... 1iw/videos
Thanks
The workaround. However, the problem is still there and I am still getting the same error message.

Thank you for helping.

Re: Cannot upload CSV

Posted: Tue Dec 17, 2019 12:21 am
by programerboy
Hi,

This is processmaker base error, please add this code to the customMimeTypes file in the exist array :
Code: Select all
path: \opt\processmaker\config\customMimeTypes.php

'csv' => 'text/csv',

https://www.youtube.com/channel/UCYiyz1 ... 1iw/videos
Thanks

Re: Cannot upload CSV

Posted: Tue Dec 17, 2019 12:25 am
by mfaisel
programerboy wrote: Tue Dec 17, 2019 12:21 am Hi,

Probably you have an error in your csv file, please test with another file with the same format.
If you are sure your file is correct, please report to ProcessMaker.

https://www.youtube.com/channel/UCYiyz1 ... 1iw/videos
Thanks
No problem spotted after I change the extension from csv to txt.

Re: Cannot upload CSV

Posted: Tue Dec 17, 2019 12:30 am
by programerboy
Please double check the previous post, I edited it

Re: Cannot upload CSV

Posted: Tue Dec 17, 2019 1:18 am
by mfaisel
programerboy wrote: Tue Dec 17, 2019 12:21 am Hi,

This is processmaker base error, please add this code to the customMimeTypes file in the exist array :
Code: Select all
path: \opt\processmaker\config\customMimeTypes.php

'csv' => 'text/csv',


https://www.youtube.com/channel/UCYiyz1 ... 1iw/videos
Thanks
Still same..
Below is my sampel data:
Code: Select all
email,claim_type_code,mode,currency,amount
[email protected],hp_bills,monthly,MYR,200
[email protected],training_seminar,yearly,MYR,2000
[email protected],subscription_memberships,yearly,MYR,2000
[email protected],travelling,monthly,MYR,500
[email protected],hp_purchase,yearly,MYR,1000
[email protected],accommodation,yearly,MYR,5000
[email protected],per_diem_allowance,monthly,MYR,500
[email protected],mileage,monthly,MYR,100