Closed Bug 295999 Opened 20 years ago Closed 19 years ago

nsIDownloadManager - addDownload is documented to have 6 args but debugger complains 8 args

Categories

(Toolkit :: Downloads API, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: u130342, Unassigned)

Details

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.8) Gecko/20050511 Firefox/1.0.4 I tried to add a file to the downloadmanager, from within a xul script. I found the addDownload and it's documented like this: nsIDownload addDownload ( nsIURI source , nsILocalFile target , PRUnichar* DisplayName , nsIMIMEInfo MIMEInfo , PRInt64 startTime , nsIWebBrowserPersist persist ); I get errors unless I add two additional arguments, but I couldn't find out the correct ones ? This is what i tried: var u="http://somehost.de/test.zip"; var ref="http://somehost.de"; var baseuri= Components .classes["@mozilla.org/network/standard-url;1"] .createInstance(Components.interfaces.nsIStandardURL); baseuri.init(baseuri.URLTYPE_STANDARD, 80, ref, "",null); var uri=Components .classes["@mozilla.org/network/standard-url;1"] .createInstance(Components.interfaces.nsIStandardURL); uri.init(uri.URLTYPE_STANDARD, 80, u, "",baseuri); uri=uri.QueryInterface(Components.interfaces.nsIURI); var persist = top.makeWebBrowserPersist(); var dlmgr= Components.classes["@mozilla.org/download-manager;1"].getService(Components.interfaces.nsIDownloadManager); var lf=Components.classes["@mozilla.org/file/local;1"] .createInstance(Components.interfaces.nsILocalFile); lf.initWithPath("c:\\xtt\\test.test.txt"); var dl=dlmgr.addDownload(uri,lf,"test",0,0,persist,0,null); Reproducible: Always Steps to Reproduce: see Details Expected Results: add a new entry to the download manager and start downloading Firefox 1.0.4
not an xpcom issue. note that in mozilla (as opposed to firefox) it does have 6 arguments. this seems like it's not a bug at all, at best in the documentation for not making it clear that it does not apply to firefox. note that this code is extremely wrong and will not produce the right results in general: >var baseuri= Components >.classes["@mozilla.org/network/standard-url;1"] >.createInstance(Components.interfaces.nsIStandardURL); >baseuri.init(baseuri.URLTYPE_STANDARD, 80, ref, "",null); you must create uris using nsIIOService (@mozilla.org/network/io-service;1).
Assignee: dougt → nobody
Component: XPCOM → Download Manager
Product: Core → Firefox
QA Contact: xpcom → download.manager
Thx for the nsIIOService info. I'll try to modify another extension to get files listed in the download window. The code snipped was just for testing. In the extension I already have a nsIURI. Well you're statement that I looked into the wrong documents makes me crasy. I was looking for different docs online, and I downloaded the firefox cvs (don't know if I got all I need), but all I found was 6 args. When I start from www.getfirefox.com I'm directed to mozilla sources, and in my case to www.xulplanet.com which was very useful in the past. Where are the correct documents? Are there any? Can you tell me what the 8 arguments are? Thx in advance. Harry
(In reply to comment #2) > Well you're statement that I looked into the wrong documents makes me crasy. I > was looking for different docs online, and I downloaded the firefox cvs (don't > know if I got all I need), but all I found was 6 args. Look in toolkit/components/downloads/public - that version has 8 args. > When I start from www.getfirefox.com I'm directed to mozilla sources, and in my > case to www.xulplanet.com which was very useful in the past. > > Where are the correct documents? Are there any? Well, xulplanet is not a mozilla.org-affiliated site... I don't know if there's any official documentation for this kind of thing, aside from the IDL comments. > Can you tell me what the 8 arguments are? See http://lxr.mozilla.org/seamonkey/source/toolkit/components/downloads/public/nsIDownloadManager.idl#68
This is an automated message, with ID "auto-resolve01". This bug has had no comments for a long time. Statistically, we have found that bug reports that have not been confirmed by a second user after three months are highly unlikely to be the source of a fix to the code. While your input is very important to us, our resources are limited and so we are asking for your help in focussing our efforts. If you can still reproduce this problem in the latest version of the product (see below for how to obtain a copy) or, for feature requests, if it's not present in the latest version and you still believe we should implement it, please visit the URL of this bug (given at the top of this mail) and add a comment to that effect, giving more reproduction information if you have it. If it is not a problem any longer, you need take no action. If this bug is not changed in any way in the next two weeks, it will be automatically resolved. Thank you for your help in this matter. The latest beta releases can be obtained from: Firefox: http://www.mozilla.org/projects/firefox/ Thunderbird: http://www.mozilla.org/products/thunderbird/releases/1.5beta1.html Seamonkey: http://www.mozilla.org/projects/seamonkey/
This appears to be a support issue. Per comments #1 and #3, the right place to find documentation on this appears to be the comments in the source. Unfortunately, we don't control the documentation on third-party sites, so this isn't our issue. Marking as INVALID, as this doesn't seem to actually be a Firefox bug.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.