Re: URLDownload with username and password
Re: URLDownload with username and password
- Subject: Re: URLDownload with username and password
- From: Marc Krochmal <email@hidden>
- Date: Tue, 23 Nov 2004 09:43:05 -0800
Miro,
I don't think you can re-use a previous URLReference. You should
create a new URLRef for the second attempt.
Best Regards,
-Marc
On Nov 23, 2004, at 6:01 AM, Miro Jurišić wrote:
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
_______________________________________________
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