Your SAS programs, embedded in web apps and elsewhere

Custom input form + method=post + upload files = not able to use SAS authentication?

Reply
Occasional Contributor
Posts: 7

Custom input form + method=post + upload files = not able to use SAS authentication?

I've been working on a custom input for that feeds my stored process and recently I added the ability to upload a file.  As a result, my previous approach that used the _username and _password parameters seems to be broken.  http://support.sas.com/documentation/cdl/en/stpug/61271/HTML/default/viewer.htm#a003259930.htm

Here's a brief history of what I have done and where I am stuck.

(I can post more code, but hopefully someone can see what I am missing with these snippets)

Version 1 - custom input form that sends parameters through the URL

<FORM name="form" id="form" METHOD="GET" ACTION="&_URL">

<INPUT TYPE="HIDDEN" id="usernm" NAME="_username" VALUE="">

<INPUT TYPE="HIDDEN" id="pass" NAME="_password" VALUE="">

This works, but since some of my text boxes are large, I'd prefer not to use GET.

Version 2 - custom input form that sends parameters via POST

<FORM name="form" id="form" METHOD="POST" ACTION="&_URL">

<INPUT TYPE="HIDDEN" id="usernm" NAME="_username" VALUE="">

<INPUT TYPE="HIDDEN" id="pass" NAME="_password" VALUE="">

This works, but recently I was asked to add the ability to upload files.  As a result, I needed to change the form enctype value.

http://support.sas.com/documentation/cdl/en/stpug/61271/HTML/default/viewer.htm#a003254547.htm

Version 3 - custom input form that sends parameters and files via POST

<FORM name="form" id="form" METHOD="POST" ACTION="&_URL" enctype="multipart/form-data">

<INPUT TYPE="HIDDEN" id="usernm" NAME="_username" VALUE="">

<INPUT TYPE="HIDDEN" id="pass" NAME="_password" VALUE="">

<INPUT type="file" id="myfile" NAME="myfile">

After executing this, the form submit takes me to the SAS Logon Manager, which I am trying to avoid by using _username and _password.  My password is encoded (I have

AllowEncodedPassword is set to true).

Does anyone know what's going on with POST when the enctype is "multipart/form-data?

Thanks.

SAS Super FREQ
Posts: 304

Re: Custom input form + method=post + upload files = not able to use SAS authentication?

Have you tried using Basic Aunthication (/do1) with Version 3?

Vince DelGobbo

SAS R&D

Occasional Contributor
Posts: 7

Re: Custom input form + method=post + upload files = not able to use SAS authentication?

Posted in reply to Vince_SAS

Yes, that did not fix the issue.  I have a ticket open with SAS.  I was able to code a work around by splitting it into two stored processes, but that's an necessary step, so I'm hopeful that SAS can resolve my ticket.

Ask a Question
Discussion stats
  • 2 replies
  • 1053 views
  • 0 likes
  • 2 in conversation