473,654 Members | 3,107 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do I tell FIREFOX to open a file

Hi, I am invoking Firefox, and for testing IE, from my VB program. The
instruction are of this kind:

Process.Start(" IExplore.exe", Parameter)
Process.Start(" Firefox.exe", Parameter)

where Parameter is a string with the path of the web page:

Parameter="C:\D ocuments and Settings\User\D esktop\Visual Studio
Projects\Test\b in\Html\webpage .htm"

Both the commands open correctly the respective applications. IE6 also
open the file. Firefox does NOT open the file. It opens and gives this
message:
-----------------------------
File not found
Firefox can't find the file at /C:/Documents.
* Check the file name for capitalization or other typing errors.
* Check to see if the file was moved, renamed or deleted.
Try Again
----------------------------

Could you tell me how to modify the file name string (Parameter), so
that Firefox take it correctly ? How does it expect the file name?

-Pam

Feb 26 '06 #1
8 4256

pa***********@l ibero.it wrote:
Hi, I am invoking Firefox, and for testing IE, from my VB program. The
instruction are of this kind:

Process.Start(" IExplore.exe", Parameter)
Process.Start(" Firefox.exe", Parameter)

where Parameter is a string with the path of the web page:

Parameter="C:\D ocuments and Settings\User\D esktop\Visual Studio
Projects\Test\b in\Html\webpage .htm"

Both the commands open correctly the respective applications. IE6 also
open the file. Firefox does NOT open the file. It opens and gives this
message:
-----------------------------
File not found
Firefox can't find the file at /C:/Documents.
* Check the file name for capitalization or other typing errors.
* Check to see if the file was moved, renamed or deleted.
Try Again
----------------------------

Could you tell me how to modify the file name string (Parameter), so
that Firefox take it correctly ? How does it expect the file name?

-Pam


Try URLEncoding the path - replacing the spaces with %20

HTH

/P.

Feb 26 '06 #2
BRAVO!!

this did it:

Try
FileName = "file:///" & FileName.Replac e(" ", "%20")
System.Diagnost ics.Process.Sta rt("Firefox.exe ", FileName)
Catch ex As Exception
MsgBox(ex.Messa ge, MsgBoxStyle.Inf ormation)
End Try

Thank you verry much!!

PS
Firefox, is always more rigorous than IE, eh? !

Is any other char that, for generality, I should take care of?
-Pam

Paxton ha scritto:
pa***********@l ibero.it wrote:
Hi, I am invoking Firefox, and for testing IE, from my VB program. The
instruction are of this kind:

Process.Start(" IExplore.exe", Parameter)
Process.Start(" Firefox.exe", Parameter)

where Parameter is a string with the path of the web page:

Parameter="C:\D ocuments and Settings\User\D esktop\Visual Studio
Projects\Test\b in\Html\webpage .htm"

Both the commands open correctly the respective applications. IE6 also
open the file. Firefox does NOT open the file. It opens and gives this
message:
-----------------------------
File not found
Firefox can't find the file at /C:/Documents.
* Check the file name for capitalization or other typing errors.
* Check to see if the file was moved, renamed or deleted.
Try Again
----------------------------

Could you tell me how to modify the file name string (Parameter), so
that Firefox take it correctly ? How does it expect the file name?

-Pam


Try URLEncoding the path - replacing the spaces with %20

HTH

/P.


Feb 26 '06 #3
If you are using dotnet, the System.Web.Http Utility class offers a
URLEncode method you can use which will take care of all chars that
might cause problems.

/P.

pamelaflue...@l ibero.it wrote:
BRAVO!!

this did it:

Try
FileName = "file:///" & FileName.Replac e(" ", "%20")
System.Diagnost ics.Process.Sta rt("Firefox.exe ", FileName)
Catch ex As Exception
MsgBox(ex.Messa ge, MsgBoxStyle.Inf ormation)
End Try

Thank you verry much!!

PS
Firefox, is always more rigorous than IE, eh? !

Is any other char that, for generality, I should take care of?
-Pam

Paxton ha scritto:
pa***********@l ibero.it wrote:
Hi, I am invoking Firefox, and for testing IE, from my VB program. The
instruction are of this kind:

Process.Start(" IExplore.exe", Parameter)
Process.Start(" Firefox.exe", Parameter)

where Parameter is a string with the path of the web page:

Parameter="C:\D ocuments and Settings\User\D esktop\Visual Studio
Projects\Test\b in\Html\webpage .htm"

Both the commands open correctly the respective applications. IE6 also
open the file. Firefox does NOT open the file. It opens and gives this
message:
-----------------------------
File not found
Firefox can't find the file at /C:/Documents.
* Check the file name for capitalization or other typing errors.
* Check to see if the file was moved, renamed or deleted.
Try Again
----------------------------

Could you tell me how to modify the file name string (Parameter), so
that Firefox take it correctly ? How does it expect the file name?

-Pam


Try URLEncoding the path - replacing the spaces with %20

HTH

/P.


Feb 26 '06 #4
I am doing a Windows Application, not a web application.
If I use:

FileName = System.Web.Http Utility.HtmlEnc ode(FileName)

I get this compiler error: 'HttpUtility' is not a member of 'Web'

I am not sure whether the above can be used in Windows application
(??). It would seems that is related with the presence of a web server.
I am not sure but I am afraid I have to code the filtering manually.

Is there a place with a full list of all need to be filtered so that I
can do it?

I could do something on the lines (perhaps a little awkward, eh?):

Dim WebSymbols As String() = New String() { _
"&", "&", _
">", ">", _
"<", "&lt;", _
...
" ", "&nbsp;", _
vbCrLf, "<br>" _
}
Function MyHtmlEncode(By Val Text As String) As String

Dim WebText As New System.Text.Str ingBuilder(Text )
For i As Integer = 0 To WebSymbols.Leng th - 1 Step 2
WebText = WebText.Replace (WebSymbols(i), WebSymbols(i + 1))
Next i
Return WebText.ToStrin g

End Function

In this case I would need a complete list of symbols. Any hint or
pointer?

Feb 26 '06 #5

pa***********@l ibero.it wrote:
I am doing a Windows Application, not a web application.
If I use:

FileName = System.Web.Http Utility.HtmlEnc ode(FileName)

I get this compiler error: 'HttpUtility' is not a member of 'Web'

I am not sure whether the above can be used in Windows application
(??). It would seems that is related with the presence of a web server.
I am not sure but I am afraid I have to code the filtering manually.

Is there a place with a full list of all need to be filtered so that I
can do it?

I could do something on the lines (perhaps a little awkward, eh?):

Dim WebSymbols As String() = New String() { _
"&", "&amp;", _
">", "&gt;", _
"<", "&lt;", _
...
" ", "&nbsp;", _
vbCrLf, "<br>" _
}
Function MyHtmlEncode(By Val Text As String) As String

Dim WebText As New System.Text.Str ingBuilder(Text )
For i As Integer = 0 To WebSymbols.Leng th - 1 Step 2
WebText = WebText.Replace (WebSymbols(i), WebSymbols(i + 1))
Next i
Return WebText.ToStrin g

End Function

In this case I would need a complete list of symbols. Any hint or
pointer?


I would have thought you could import the namespace into your project
and use its methods. I thought that was one of the main points behind
OOP in dotnet.

Alternatively, create a blank file in notepad, give it a name using all
the legal filename special characters and save it as an htm file -
something like "£$% ^&!*()_+=-.htm. Then browse to it with Firefox
and see which of the special chars it's happy with, and which ones it
encodes in the address bar.

If you want further advice/help with dotnet, one of the
microsoft.publi c.dotnet.framew ork* groups would be best. The CSS bods
of this group are probably wondering what on earth we are going on
about :-)

/P.

Feb 27 '06 #6
pa***********@l ibero.it schrieb:
BRAVO!!

this did it:

Try
FileName = "file:///" & FileName.Replac e(" ", "%20")
System.Diagnost ics.Process.Sta rt("Firefox.exe ", FileName)
Catch ex As Exception
MsgBox(ex.Messa ge, MsgBoxStyle.Inf ormation)
End Try

Thank you verry much!!


What's that got to do with CSS?
Feb 27 '06 #7
Yes, Christian is perfectly right!!

Actually, it's because the original question regarded essentially
Firefox.

I remember that in the past I came here a couple of times and actually
the guys here let me understand how important is Firefox in the
browser's world (where I am it is hardly known) and how important is to
make application which also support well Firefox.

I also remembered how good and helpful are the people in this group. So
having a question about Firefox, this seemed the first choice to go.
Sorry if it is turning OT.

Ah, an observation (more on topic) . I have seen that in web page we
(and hence any filter) replace " " with &nbsp; while within the command
line this doesn't work and it wants "%20". So I am just thinking that
perhaps for the the command line (file name, etc.) the replacement can
be different wrt to the html body (??) Is this so?

thank you very much

-Pam

The CSS bods
of this group are probably wondering what on earth we are going on
about :-)

/P.


Feb 27 '06 #8
In <11************ **********@e56g 2000cwe.googleg roups.com>, on
02/27/2006
at 09:40 AM, pa***********@l ibero.it said:
I also remembered how good and helpful are the people in this group.


Sure, for questions about CSS. Why do you expect people to be less
helpful if you post a question to the proper group?

--
Shmuel (Seymour J.) Metz, SysProg and JOAT <http://patriot.net/~shmuel>

Unsolicited bulk E-mail subject to legal action. I reserve the
right to publicly post or ridicule any abusive E-mail. Reply to
domain Patriot dot net user shmuel+news to contact me. Do not
reply to sp******@librar y.lspace.org

Feb 28 '06 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
9281
by: Jeremy Epstein | last post by:
I've got a 4-page form that lets users enter a whole lot of information, which is then submitted and emailed at the end. All the fields are stored as session data. The whole thing works fine: 1. On my local box (WinXP / Apache2 / PHP4) using IE6 2. On my local box using Firefox1 3. On my hosted server (RHLinux / Apache1.3 / PHP4) using IE6
2
3485
by: Matthias Huening | last post by:
Hi, os.startfile('http://www.python.org') works fine on WinXP with IE as default webbrowser. With Mozilla Firefox 0.9 as default webbrowser, however, I get an error. Firefox starts, the page gets loaded and then Python gives me an error message (Traceback below). The same is true for the webbowser module. Is this a Python problem or a Firefox problem? Matthias
5
31217
by: Derek Erb | last post by:
I am banging my head against the wall with this one. The following code snippets work perfectly fine in MSIE6. But produce an error in Firefox and do not work at all. BROWSER.HTM <HTML> .... <div class="Abb"> <h2 id="ABTit">BROWSER</h2> </div>
5
6944
by: GEL | last post by:
Hi, I want to open a new browser window, let the user use that window for several minutes, and when they close, I'd like to change the page displayed in the original window. According to numerous articles found Googling, this should work, but on my WinXP system, using Firefox and IE, I get nothing (when allowing pop-ups, if pop-ups are disabled, IE reports the window is closed, Firefox gives a JS error on checking the window handle). No...
4
32840
by: Yuri Vorontsov | last post by:
Hallo! We have troubles (post XP SP2) to open local folders from the web application: - the web application allows users to select a local file (input type=file) - the system DOES NOT upload the file but stores the path to the folder containing this file into a database. - the path to the local folder is linked as <a href=file:///blablabla/folder>Open folder</a> - we used to be able to open the folder by clicking on the link above but...
14
24221
by: David Blickstein | last post by:
I have some XML documents that I want to open in a web browser and be automatically translated to HTML via XSLT. I'm using an xml-stylesheet processing command in a file called "girml.xml". This all works in Internet Explorer, but doesn't work with Firefox. In both IE and Firefox this works: <?xml-stylesheet type="text/xsl" encoding="UTF-8" href="makehtml.xslt" version="1.0"?>
5
3111
by: SPE - Stani's Python Editor | last post by:
Hi, During optimizing SPE for Ubuntu, I found something strange. I have Ubuntu 5.10 "The Breezy Badger" and unfortunately this code is not working: >>> import webbrowser >>> webbrowser.open("http://www.python.org") It does not throw an exception, but is not able to launch a browser.
3
2601
omerbutt
by: omerbutt | last post by:
sir i am making an inventory application with the help of ajax,html,dhtml,javascript php and mysql i have been working with AJAX and ASP CLASSIC ,but now i have switched to php the problem i am facing is that i have made a form and now i want to post this form through AJAX funtion named Addstk(frmobj); on to a next php page where i am getting the form input values ,i have declared the getxmlhttpobject() function and the statechanged()...
5
1826
by: sheldonlg | last post by:
I am top-posting this one time because this in new stuff and I am leaving the bottom for reference and description of the problem. I am also adding comp.lang.php as this is all done in php and there is a remote possiblity that I have to do something else in php. What is sent from php is as follows: Headers (done with header calls): Content-type: application/vnd.ms-excel Content-Disposition: attachment; filename=foo.xls
0
8375
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8290
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8707
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7306
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6161
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4149
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4294
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2714
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1593
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.