HighDots Forums  

How do I tell FIREFOX to open a file

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss How do I tell FIREFOX to open a file in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
pamelafluente@libero.it
 
Posts: n/a

Default How do I tell FIREFOX to open a file - 02-26-2006 , 02:48 PM






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:\Documents and Settings\User\Desktop\Visual Studio
Projects\Test\bin\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


Reply With Quote
  #2  
Old   
Paxton
 
Posts: n/a

Default Re: How do I tell FIREFOX to open a file - 02-26-2006 , 03:40 PM







pamelafluente (AT) libero (DOT) it wrote:
Quote:
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:\Documents and Settings\User\Desktop\Visual Studio
Projects\Test\bin\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.



Reply With Quote
  #3  
Old   
pamelafluente@libero.it
 
Posts: n/a

Default Re: How do I tell FIREFOX to open a file - 02-26-2006 , 03:56 PM



BRAVO!!

this did it:

Try
FileName = "file:///" & FileName.Replace(" ", "%20")
System.Diagnostics.Process.Start("Firefox.exe", FileName)
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Information)
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:

Quote:
pamelafluente (AT) libero (DOT) 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:\Documents and Settings\User\Desktop\Visual Studio
Projects\Test\bin\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.


Reply With Quote
  #4  
Old   
Paxton
 
Posts: n/a

Default Re: How do I tell FIREFOX to open a file - 02-26-2006 , 04:08 PM



If you are using dotnet, the System.Web.HttpUtility class offers a
URLEncode method you can use which will take care of all chars that
might cause problems.

/P.



pamelaflue... (AT) libero (DOT) it wrote:
Quote:
BRAVO!!

this did it:

Try
FileName = "file:///" & FileName.Replace(" ", "%20")
System.Diagnostics.Process.Start("Firefox.exe", FileName)
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Information)
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:

pamelafluente (AT) libero (DOT) 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:\Documents and Settings\User\Desktop\Visual Studio
Projects\Test\bin\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.


Reply With Quote
  #5  
Old   
pamelafluente@libero.it
 
Posts: n/a

Default Re: How do I tell FIREFOX to open a file - 02-26-2006 , 05:23 PM



I am doing a Windows Application, not a web application.
If I use:

FileName = System.Web.HttpUtility.HtmlEncode(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(ByVal Text As String) As String

Dim WebText As New System.Text.StringBuilder(Text)
For i As Integer = 0 To WebSymbols.Length - 1 Step 2
WebText = WebText.Replace(WebSymbols(i), WebSymbols(i + 1))
Next i
Return WebText.ToString

End Function

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


Reply With Quote
  #6  
Old   
Paxton
 
Posts: n/a

Default Re: How do I tell FIREFOX to open a file - 02-27-2006 , 04:03 AM




pamelafluente (AT) libero (DOT) it wrote:
Quote:
I am doing a Windows Application, not a web application.
If I use:

FileName = System.Web.HttpUtility.HtmlEncode(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;", _
">", ">", _
"<", "&lt;", _
...
" ", "&nbsp;", _
vbCrLf, "<br>" _
}


Function MyHtmlEncode(ByVal Text As String) As String

Dim WebText As New System.Text.StringBuilder(Text)
For i As Integer = 0 To WebSymbols.Length - 1 Step 2
WebText = WebText.Replace(WebSymbols(i), WebSymbols(i + 1))
Next i
Return WebText.ToString

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.public.dotnet.framework* groups would be best. The CSS bods
of this group are probably wondering what on earth we are going on
about :-)

/P.



Reply With Quote
  #7  
Old   
Christian Kirsch
 
Posts: n/a

Default Re: How do I tell FIREFOX to open a file - 02-27-2006 , 05:57 AM



pamelafluente (AT) libero (DOT) it schrieb:
Quote:
BRAVO!!

this did it:

Try
FileName = "file:///" & FileName.Replace(" ", "%20")
System.Diagnostics.Process.Start("Firefox.exe", FileName)
Catch ex As Exception
MsgBox(ex.Message, MsgBoxStyle.Information)
End Try

Thank you verry much!!

What's that got to do with CSS?


Reply With Quote
  #8  
Old   
pamelafluente@libero.it
 
Posts: n/a

Default Re: How do I tell FIREFOX to open a file - 02-27-2006 , 11:40 AM



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
Quote:
of this group are probably wondering what on earth we are going on
about :-)

/P.


Reply With Quote
  #9  
Old   
Shmuel (Seymour J.) Metz
 
Posts: n/a

Default Re: How do I tell FIREFOX to open a file - 02-28-2006 , 07:25 AM



In <1141062047.068833.228510 (AT) e56g2000cwe (DOT) googlegroups.com>, on
02/27/2006
at 09:40 AM, pamelafluente (AT) libero (DOT) it said:

Quote:
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 spamtrap (AT) library (DOT) lspace.org



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.