Problem with content type in request-header on px-web

36 views
Skip to first unread message

Heiðrún Sigurðardóttir

unread,
Oct 11, 2024, 4:54:41 AM10/11/24
to pca...@googlegroups.com
Hi everyone,

We are looking at  Flourish https://flourish.studio/ to publish graphs on our website, we want's to get automatic updates from px-tables, with saved queries.


We are testinging this now if it‘s possible to use Flourish with saved queries for csv files.

 

Flourish want‘s a request header that has content-type other than octet-stream, which we get from px-web. We tried to change mime-types to „text/csv“ or „application/binary“ on our IIS webserver with no success. Could it be that this functionality is in the code so we are not able to change it? Or is it possible that we can change it in the PX-Web Administration? Any suggestion for solution?

 

This is the error analysis from Flourish:

image.png


With best regards and thanks

Heiðrún Sigurðardóttir

Hagstofa Íslands

 

Petros Likidis

unread,
Oct 14, 2024, 3:08:40 AM10/14/24
to pca...@googlegroups.com
Hi,

You should be able to override these values by editing a config file but when I tried it it did not work.
I can try to create a fix for it for your version and we can see if it works. If so, which version do you use?

Kind regards
Petros


--
You received this message because you are subscribed to the Google Groups "pcaxis" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pcaxis+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pcaxis/CAMt%3Dq7mWcHE%2B2%3DJScAGjonMyzT5J4HKX4t-tsy6gkOYr-PC%2B-Q%40mail.gmail.com.

Heiðrún Sigurðardóttir

unread,
Oct 14, 2024, 4:57:21 AM10/14/24
to pca...@googlegroups.com
Hi Petros,

Thank you for the e-mail. 
If you can create a fix it would be very nice, our version is PxWeb 2022 v1.

With best regards and thanks
Heiðrún 
Hagstofa Íslands


Petros Likidis

unread,
Oct 15, 2024, 2:04:06 AM10/15/24
to pca...@googlegroups.com
Hi,

I should say that I have not properly tested this with an existing PxWeb 2022v1 installation. So follow carefully the steps to be able to recover.

1. Copy the file PCAxis.Web.Controls.dll from your installation directory to a safe place.
2. Download the updated PCAxis.Web.Controls.dll from https://github.com/statisticssweden/PxWeb/releases/tag/2022.v1 the filename is Fix-PCAxis.Web.Controls.zip.
3. Remove the security block of downloaded files by selecting Properties for the downloaded zip file and select Unblock and OK.
image.png
4. Unzip the file.
5. Take the updated PCAxis.Web.Controls.dll that you extracted in step 4 and replace the one in your installation folder of PxWeb.
6. In the file CommandBarCustomFileTypesPlugins.config right before the closing root element, </FileTypeList>, place the following chunk of XML and save it.

<FileType Active="true">
  <Type>csv</Type>
  <AssemblyQualifiedName>PCAxis.Paxiom.PrnFileSerializer, PCAxis.Core, Version=1.1.0.0</AssemblyQualifiedName>
  <Creator>PCAxis.Web.Controls.CsvSerializerCreator, PCAxis.Web.Controls</Creator>
  <FileInfos>
    <FileInfo>FileTypeCsvWithHeadingAndTabulator</FileInfo>
      <FileInfo>FileTypeCsvWithoutHeadingAndTabulator</FileInfo>
      <FileInfo>FileTypeCsvWithHeadingAndComma</FileInfo>
      <FileInfo>FileTypeCsvWithoutHeadingAndComma</FileInfo>
      <FileInfo>FileTypeCsvWithHeadingAndSpace</FileInfo>
      <FileInfo>FileTypeCsvWithoutHeadingAndSpace</FileInfo>
      <FileInfo>FileTypeCsvWithHeadingAndSemiColon</FileInfo>
      <FileInfo>FileTypeCsvWithoutHeadingAndSemiColon</FileInfo>
  </FileInfos>
  <WebControl>PCAxis.Web.Controls.PrnFileType, PCAxis.Web.Controls, Version=1.1.0.0</WebControl>
  <MimeType>application/csv</MimeType>
  <FileExtension>csv</FileExtension>
  <CssClass>?</CssClass>
  <Image>button_save_as_csv.png</Image>
  <ShortcutImage>small_button_csv.png</ShortcutImage>
</FileType>

7. Restart PxWeb to pick up the changes.
8. Verify that it works.

If it does not work, rollback the changes by replacing the updated PCAxis.Web.Controls.dll with the one that you copied to a safe place in step 1.

Kind regards
Petros


Heiðrún Sigurðardóttir

unread,
Oct 15, 2024, 5:41:17 AM10/15/24
to pca...@googlegroups.com
Hi again,

Thank you very much for this. We will test this and let you know how it works.

With be
Heiðrún

Reply all
Reply to author
Forward
0 new messages