NAV2016 Upload Temp MSAccess File to Server using CU419

rsaritzkyrsaritzky Member Posts: 469
Hi all,

I'm upgrading a process from NAV2009 Classic that takes a small MSAccess file (.mdb) and uses the JET OLEDB driver to import this data into NAV.
In NAV2016, the process requires (as far as I know) that you create a temporary file on the server and upload the file to that temporary file. Then, the NAV codeunit can find the file.

I'm using "standard" functions in CU419 (File Management) to create the temporary file and upload the file
FileName := FileMgt.OpenFileDialog('Select Access Import File','','All Files (*.*)|*.*');
ServerFileName := FileMgt.UploadFileSilent(FileName);

When I select the .mdb file, I get the following error:
The file that you are trying to create cannot be created. The destination file has an extension that may be blocked. Contact your system administrator.

I did a test and renamed the .mdb file to .txt, and it uploaded just fine.

So, my question is if this is a restriction of CU419/NAV, or is this a Windows security type of error that has nothing to do with NAV?

Thanks in advance,

Ron

Ron

Best Answer

  • rsaritzkyrsaritzky Member Posts: 469
    Answer ✓
    Hi all,

    I found my own answer:

    There is a parameter in CustomSettings.config on the server called ClientServicesProhibitedFileTypes which will not allow you to create files with certain extensions.

    The default string is:

    "ade;adp;app;asp;bat;bas;chm;cmd;com;cpl;csh;exe;fxp;gadget;hlp;hta;inf;ins;isp;its;js;jse;ksh;lnk;mad;maf;mag;mam;maq;mar;mas;mat;mau;mav;maw;mda;mdb;mde;mdt;mdw;mdz;msc;msi;msp;mst;ops;pcd;pif;prf;prg;pst;reg;scf;scr;sct;shb;shs;url;vb;vbe;vbs;vsmacros;vss;vst;vsw;ws;wsc;wsf;wsh"

    I removed the "mdb" value from this property and restarted the service tier.

    File uploads now OK.
    Ron

Answers

  • rsaritzkyrsaritzky Member Posts: 469
    Answer ✓
    Hi all,

    I found my own answer:

    There is a parameter in CustomSettings.config on the server called ClientServicesProhibitedFileTypes which will not allow you to create files with certain extensions.

    The default string is:

    "ade;adp;app;asp;bat;bas;chm;cmd;com;cpl;csh;exe;fxp;gadget;hlp;hta;inf;ins;isp;its;js;jse;ksh;lnk;mad;maf;mag;mam;maq;mar;mas;mat;mau;mav;maw;mda;mdb;mde;mdt;mdw;mdz;msc;msi;msp;mst;ops;pcd;pif;prf;prg;pst;reg;scf;scr;sct;shb;shs;url;vb;vbe;vbs;vsmacros;vss;vst;vsw;ws;wsc;wsf;wsh"

    I removed the "mdb" value from this property and restarted the service tier.

    File uploads now OK.
    Ron
Sign In or Register to comment.