Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How <cfspreadsheet> to read a password protected excel file?

Community Beginner ,
Oct 15, 2021 Oct 15, 2021

Hello All:

I tried to read password protected excel file by using this line of code

<cfspreadsheet action="read" query="MyControlPanelQuery" src="D:/LocalDocuments/FileName.xlsx">

I gave me this error "

An error occurred while reading the Excel: org.apache.poi.EncryptedDocumentException: The supplied spreadsheet is protected, but no password was supplied
"

I got this kind of error because the FileName.xlsx is password protected

The thing is "<cfspreadsheet action="read"....> doesn't any attribute to read a password protected excel file.

Any advice please?

 

Thank you

865
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Oct 15, 2021 Oct 15, 2021

Use the "password" attribute to provide the password.

See the documentation for details.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 17, 2021 Oct 17, 2021

The <cfspreadsheet action="read"....> doesn't have password attribute...but the <cfspreadsheet action="write"..> does.

This line 

<cfspreadsheet action="read" query="MyControlPanelQuery" src="D:/LocalDocuments/MyControlPanelData.xlsx" headerrow="1" password="123">

 give me this error:

Attribute validation error for tag CFSPREADSHEET.

It does not allow the attribute(s) PASSWORD. The valid attribute(s) are ACTION,COLUMNNAMES,COLUMNS,EXCLUDEHEADERROW,FORMAT,HEADERROW,NAME,QUERY,ROWS,SHEET,SHEETNAME,SRC.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Oct 18, 2021 Oct 18, 2021

That sounds like a bug. Report it to Adobe and post your bug report number here so we can vote on it.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 18, 2021 Oct 18, 2021

You are right, @pham_mn . I cannot get the password attribute to work with any of the actions <cfspreadsheet action="read">, <cfspreadsheet action="update"> and <cfspreadsheet action="write">. 😞

 

I have been testing on ColdFusion 2021 Update 2. What is your ColdFusion version?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 22, 2021 Oct 22, 2021

I am using CF2016. 

Thank you.

Also for some reason I don't receive notification via email any more

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 22, 2021 Oct 22, 2021

Pham, as for getting email notifications, have you enabled the settings for that at the bottom of the profile notifications tab? And is the email on the first tab correct?

 

Finally, are you sure that the emails are not blocked by some spam filter on your end or at your mail server? 


/Charlie (troubleshooter, carehart. org)
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 16, 2021 Oct 16, 2021

 

The thing is "<cfspreadsheet action="read"....> doesn't any attribute to read a password protected excel file.


By pham_mn

 

Why do you say that? As @EddieLotter has said, cfspreadsheet has a password attribute. But, suppose Filename.xlsx is itself not password-protected. Then use as the value of the password attribute the password that offers read permissions D:/LocalDocuments.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 23, 2021 Oct 23, 2021
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Oct 25, 2021 Oct 25, 2021

Voted.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 25, 2021 Oct 25, 2021
LATEST

Thanks, @EddieLotter .

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources