Major Server.HTMLEncode Problems

Results 1 to 2 of 2

Thread: Major Server.HTMLEncode Problems

  1. #1
    C83 Guest

    Default Major Server.HTMLEncode Problems

    I hope this is a simple problem, but I&#039ve consulted the literature and can&#039t figure it out.<BR><BR>Here&#039s what I have:<BR><BR>What I want to happen is this: I have a members-only section whereby members can upload files to share with each other. During the upload, the filename and date uploaded are put into a simple Acess Database - 1 table, 2 fields. This is done so members can only view the files uploaded by each other, and not view all the files actually in the directory.<BR><BR>The View Uploaded Files Page simply opens the database and reads the filename into a simple list like below:<BR><BR>Filename1.doc date<BR>Filename2.doc date<BR>Filename3.doc date<BR>Filename4.doc date<BR><BR> .. whereby each filename is linked tothe file itself, so members can view/download the file. My problem is this: How can I link to files and have it downlaod filenames with spaces in the name.<BR><BR>Example: "My File 1.doc" uploads and is stored on my server fine. But when it read sthe file name from the database and links to it, it doesn&#039t work correctly. Internet Explorer sort of works. On the status bar, when i mouse-over the link, it reads:<BR> File 1.doc<BR><BR>...and when I click the link it opens:<BR><BR><BR><BR>This all appears correct *** But in NETSCAPE, everything appears the same until I click the link at which point I get a HTTP 400 Error about bad syntax. <BR><BR>I know this is a long description of what probably is a simple problem, but can anyone help?!?!?!?!?<BR><BR>My syntax for the link is as follows:<BR><BR>server.HTMLEncode(uploaded_filenam e)<BR><BR>When I tried URLEncode, it still wouldn&#039t work.<BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default HTMLEncode surely wrong answer

    *IF* it would work, URLEncode is the right answer.<BR><BR>HTMLEncode is the thing that changes &LT; into &amp;LT; (for example).<BR><BR>URLEncode is the thing that should change a space to either a plus or a %20.<BR><BR>HOWEVER...I think you are going to have to detect the browser type and use the appropriate form for the given browser.<BR><BR>In MSIE, leave the space alone.<BR><BR>In NS, convert every space to %20 (use Replace(filename," ","%20") of course).<BR><BR>I *think* that works. It certainly works on my local machine.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts