Jim,
Thanks for the reply but those are the specs. I used to write my code. The
URL I build will work directly in the browser because I can enter my
credentials twice - the first time for dbupload.cgi and the second when
dbupload.cgi redirects to dbmake.cgi. When I try to do the same thing using
the WinHttpReq objects (see example below - which work directly with IE) - I
get a 401 authorization error. Although the credentials get passed correctly
to dbmake.cgi they don't get passed to dbmake.cgi (called from dbmake.cgi as
a redirect) which causes the credentials error.
If I can break the the call into two seperate calls (see
http://www.shopsite.com/help/8.0/en-US/ ... pload.htmlfor MIME example) then I can get around this. The problem is that I don't
find an example URL which show dbmake.cgi how to select the MIME folder on
your local machine - I'm sure there is a set of parameters to do this but I
don't see them in the documentation. The example has the path in the MIME
file but you have to point to the MIME file first in the dbmake.cgi URL.
Sample Javascript to import a file which has already been FTP'd to the
server in the correct location - uses IE and passes on credentials (Gives a
401 authorization error):
------------------------------------------------------------------------------------------------------------------------------------------
SCRIPT language="JavaScript"
var WinHttpReq = new ActiveXObject("WinHttp.WinHttpRequest.5.1");
var URL = "http://www.testsite.com/shopsite_sc/ss/dbupload.cgi";
var Parameters =
"clientApp=1&dbname=products&filename=products_3242006_24041AM.xml&uniqueName=SKU&checkpoint=500&newRecords=yes&use_optimizer=no&defer_linking=no";
WinHttpReq.Open("POST", URL, false);
WinHttpReq.SetCredentials("login","password",0);
WinHttpReq.Send(Parameters);
document.write(WinHttpReq.GetAllResponseHeaders);
document.write(WinHttpReq.ResponseText);
/SCRIPT
------------------------------------------------------------------------------------------------------------------------------------------
Sample Javascript to rebuild site (works correctly with credentail passed
thru becuase there is no redirect):
------------------------------------------------------------------------------------------------------------------------------------------
SCRIPT language="JavaScript"
var WinHttpReq = new ActiveXObject("WinHttp.WinHttpRequest.5.1");
var URL =
"http://www.testsite.com/shopsite_sc/ss/generate.cgi?clientApp=1&htmlpages=1&custompages=1&index=1®en=1"
WinHttpReq.Open("GET", URL, false);
WinHttpReq.SetCredentials("login","password",0);
WinHttpReq.Send();
document.write(WinHttpReq.GetAllResponseHeaders);
document.write(WinHttpReq.ResponseText);
/SCRIPT
------------------------------------------------------------------------------------------------------------------------------------------
Any further help would be appreciated.
Thanks,
Stan
"Jim" <jstavast@xmission.com> wrote in message
news:e1e2k4$c8r$1@eval.shopsite.com...
Have you checked the online help at
http://www.shopsite.com/help/8.0/en-US/ ... pload.htmland the sdk documentation at
http://www.shopsite.com/help/8.0/en-US/ ... L_SDK.htmlThere is a link on that page to a sample perl program.
Jim
Stan Shaul wrote:
Does anyone know what parameters need to be passed to dbupload.cgi (i.e.
in the URL) in order to specify the MIME product file to be uploaded from
a local path? An example would be great.
I am trying to have MS Access upload product data automatically and have
tried FTP'ing the file up to the server and then running dbupload.cgi but
I am getting authentication issues when dbupload.cgi redirects to
dbmake.cgi (doesn't pass on my authentication with the redirect). If I
can call dbupload.cgi with a MIME version of the xml file and
authenticate, have it return the parameters to pass to dbmake.cgi, and
then call dbmake.cgi with the parameter list and authenticate, I think I
can get around this.
Any help would be appreciated.
Thanks,
Stan Shaul
sportsflix.com