URLDownload with username and password
URLDownload with username and password
- Subject: URLDownload with username and password
- From: Miro Jurišić <email@hidden>
- Date: Tue, 23 Nov 2004 09:01:35 -0500
My code says:
OSStatus err = ::URLDownload(updateURL,
const_cast<FSSpec*>(&download.GetFSSpec()), 0, kURLReplaceExistingFlag,
0, 0);
// Prompt for password
if (err == kURLAuthenticationError) {
Str255 username;
Str255 password;
// Prompt for username and password
::URLSetProperty(updateURL, kURLUserName,
reinterpret_cast<char*>(&usernamePStr[0]), StrLength(usernamePStr) +
1);
::URLSetProperty(updateURL, kURLPassword,
reinterpret_cast<char*>(&passwordPStr[0]), StrLength(passwordPStr) +
1);
::URLDownload(updateURL,
const_cast<FSSpec*>(&download.GetFSSpec()), 0, kURLReplaceExistingFlag,
0, 0);
}
but the second call to URLDownload fails with kURLAuthenticationError
again. Why? The username and password are correct, as pstrings, and
URLSetProperty returns noErr.
Thanks,
meeroh
--
<http://web.meeroh.org/> | KB1FMP
"And when I have understanding of computers, I shall be
the supreme being!" -- Evil, "Time Bandits"
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden