473,603 Members | 2,635 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

encoding file name not working with # sign

Hello,

A .NET 1.1 web app...

I create a hyperlink with a complete filename, and the target is for a new
window to open. Right now the filenames are all PDF files.
Everything works fine, the PDF opens in a new window - until a filename
containing a # sign is clicked. A window still opens up but I get the
dreaded 'Page cannot be displayed' error. I wrapped the filename around the
encode method so that the # sign is properly encoded, but the error persists!!

The user can right click on the link, save the file to their hard drive and
when they double click on that file, naturally Acrobat Reader opens the file
with no problem.

Any help on this? What can I do to ge the file to open on a hyperlink click?

Thanks in advance - Hedge
Feb 1 '06 #1
8 1356
Hello Tony,
Hello,

A .NET 1.1 web app...

I create a hyperlink with a complete filename, and the target is for a
new
window to open. Right now the filenames are all PDF files.
Everything works fine, the PDF opens in a new window - until a
filename
containing a # sign is clicked. A window still opens up but I get the
dreaded 'Page cannot be displayed' error. I wrapped the filename
around the
encode method so that the # sign is properly encoded, but the error
persists!!
The user can right click on the link, save the file to their hard
drive and when they double click on that file, naturally Acrobat
Reader opens the file with no problem.

Any help on this? What can I do to ge the file to open on a hyperlink
click?


Are you sure this isn't a client-side (read: browser) issue? Do you even
get a page hit on the server when clicking such a link?

Cheers,
--
Joerg Jooss
ne********@joer gjooss.de
Feb 1 '06 #2
Hello Tony,

It's a well-known problem with # sign. I've never met solution, besides don't
use # in path
Nothing else.

TH> I create a hyperlink with a complete filename, and the target is for
TH> a new
TH> window to open. Right now the filenames are all PDF files.
TH> Everything works fine, the PDF opens in a new window - until a
TH> filename
TH> containing a # sign is clicked. A window still opens up but I get
TH> the
TH> dreaded 'Page cannot be displayed' error. I wrapped the filename
TH> around the
TH> encode method so that the # sign is properly encoded, but the error
TH> persists!!
TH> The user can right click on the link, save the file to their hard
TH> drive and when they double click on that file, naturally Acrobat
TH> Reader opens the file with no problem.

---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/members/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Feb 1 '06 #3
Hello Joerg,
I don't believe it is a client-side issue because everything works fine as
long as the # sign is not in the filename. In other words, the new window
will open up, Acrobat Reader will load, and the file is displayed.

Thanks - Hedge

"Joerg Jooss" wrote:
Hello Tony,
Hello,

A .NET 1.1 web app...

I create a hyperlink with a complete filename, and the target is for a
new
window to open. Right now the filenames are all PDF files.
Everything works fine, the PDF opens in a new window - until a
filename
containing a # sign is clicked. A window still opens up but I get the
dreaded 'Page cannot be displayed' error. I wrapped the filename
around the
encode method so that the # sign is properly encoded, but the error
persists!!
The user can right click on the link, save the file to their hard
drive and when they double click on that file, naturally Acrobat
Reader opens the file with no problem.

Any help on this? What can I do to ge the file to open on a hyperlink
click?


Are you sure this isn't a client-side (read: browser) issue? Do you even
get a page hit on the server when clicking such a link?

Cheers,
--
Joerg Jooss
ne********@joer gjooss.de

Feb 1 '06 #4
Hello Michael,

As a 'workaround', I've told the users not to create filenames with # signs
in them. It is just a habit that they have to break.

I think you are right about a solution not existing, I've yet to find one.

Thanks - Tony

"Michael Nemtsev" wrote:
Hello Tony,

It's a well-known problem with # sign. I've never met solution, besides don't
use # in path
Nothing else.

TH> I create a hyperlink with a complete filename, and the target is for
TH> a new
TH> window to open. Right now the filenames are all PDF files.
TH> Everything works fine, the PDF opens in a new window - until a
TH> filename
TH> containing a # sign is clicked. A window still opens up but I get
TH> the
TH> dreaded 'Page cannot be displayed' error. I wrapped the filename
TH> around the
TH> encode method so that the # sign is properly encoded, but the error
TH> persists!!
TH> The user can right click on the link, save the file to their hard
TH> drive and when they double click on that file, naturally Acrobat
TH> Reader opens the file with no problem.

---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/members/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche

Feb 1 '06 #5
Hello again,

More info: IE seems to mis-interpret the # sign in a filename as a bookmark.

"Tony Hedge" wrote:
Hello,

A .NET 1.1 web app...

I create a hyperlink with a complete filename, and the target is for a new
window to open. Right now the filenames are all PDF files.
Everything works fine, the PDF opens in a new window - until a filename
containing a # sign is clicked. A window still opens up but I get the
dreaded 'Page cannot be displayed' error. I wrapped the filename around the
encode method so that the # sign is properly encoded, but the error persists!!

The user can right click on the link, save the file to their hard drive and
when they double click on that file, naturally Acrobat Reader opens the file
with no problem.

Any help on this? What can I do to ge the file to open on a hyperlink click?

Thanks in advance - Hedge

Feb 1 '06 #6
The # sign is to specifiy a location inside a document. IMO it won't work in
a href link. A workaround could be to have the page stream the file to the
browser ... (using the "attachment;fil ename=myfile#so mething.pdf" content
disposition header).
--
Patrice

"Tony Hedge" <To*******@disc ussions.microso ft.com> a écrit dans le message
de news:3E******** *************** ***********@mic rosoft.com...
Hello,

A .NET 1.1 web app...

I create a hyperlink with a complete filename, and the target is for a new
window to open. Right now the filenames are all PDF files.
Everything works fine, the PDF opens in a new window - until a filename
containing a # sign is clicked. A window still opens up but I get the
dreaded 'Page cannot be displayed' error. I wrapped the filename around the encode method so that the # sign is properly encoded, but the error persists!!
The user can right click on the link, save the file to their hard drive and when they double click on that file, naturally Acrobat Reader opens the file with no problem.

Any help on this? What can I do to ge the file to open on a hyperlink click?
Thanks in advance - Hedge

Feb 2 '06 #7
Thank you Patrice, I will look into your workaround.

Tony

"Patrice" wrote:
The # sign is to specifiy a location inside a document. IMO it won't work in
a href link. A workaround could be to have the page stream the file to the
browser ... (using the "attachment;fil ename=myfile#so mething.pdf" content
disposition header).
--
Patrice

"Tony Hedge" <To*******@disc ussions.microso ft.com> a écrit dans le message
de news:3E******** *************** ***********@mic rosoft.com...
Hello,

A .NET 1.1 web app...

I create a hyperlink with a complete filename, and the target is for a new
window to open. Right now the filenames are all PDF files.
Everything works fine, the PDF opens in a new window - until a filename
containing a # sign is clicked. A window still opens up but I get the
dreaded 'Page cannot be displayed' error. I wrapped the filename around

the
encode method so that the # sign is properly encoded, but the error

persists!!

The user can right click on the link, save the file to their hard drive

and
when they double click on that file, naturally Acrobat Reader opens the

file
with no problem.

Any help on this? What can I do to ge the file to open on a hyperlink

click?

Thanks in advance - Hedge


Feb 2 '06 #8
Hello Tony,
Hello Joerg,
I don't believe it is a client-side issue because everything works
fine as long as the # sign is not in the filename.


That doesn't proof anything, does it? It could be that exactly this kind
of string is not handled correctly by thr browser. I don't say it's very
likely, but simply firing up another browser will certainly show what's going
on. You can also check whether you get a server hit if that error shows up.

Cheers,
--
Joerg Jooss
ne********@joer gjooss.de
Feb 2 '06 #9

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

Similar topics

8
2474
by: davisjoseph | last post by:
Hi All, I'm newbie to this XML world. My problem is to identify the encoding type of XML at runtime. What currently I'm doing is checking whether BOM is available in the XML; based on the BOM I'm identifying the encoding type. Here is the problem, some type of UTF-8 encoded file does'nt have BOM in the starting. So I'm identying the file as iso-8859-1 encoded which is actually encoded in UTF-8. I dont have much idea about the...
2
2627
by: Jim Lawton | last post by:
Hi, ..net c# httphandler straight html form at browser. GBP pound sign problem (I know I know - I *can* decode it, but I've got to understand what and why I should be doing stuff) I am uploading text data from a form. This data is either directly input into a textarea, or is a file stream originating from a .txt file, (or other basic text file (like off Mac or Unix - of course I don't necessarily know at present it's
10
30133
by: Mark Rae | last post by:
Hi, I'm in the process if converting the data out of an old DOS-based SunAccounts system (don't ask!) into SQL Server. The data has been sent to me as a collection of hundreds of SunAccounts backup files and it's a simple (yet extremely laborious!) process of opening each backup file in turn, reading the file line by line, splitting it up into its constituent parts, and then squirting it into SQL Server.
8
2673
by: Erwin Moller | last post by:
Hi group, I could use a bit of guidance on the following matter. I am starting a new project now and must make some decisions regarding encoding. Environment: PHP4.3, Postgres7.4.3 I must be able to receive forminformation and store that in a database and later produce it on screen on the client (just plain HTML).
0
7996
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
7928
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
8415
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8273
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6735
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
5878
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
5441
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2430
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
1
1514
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.