.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Not able to browse a PDF file with space in the file name through the browser(IE 8.0/ Mozilla)

Posted By:      Posted Date: October 26, 2010    Points: 0   Category :ASP.Net

Hi Team,

 I am trying to access a link in the ASP.NET page. This link should open a PDF file in browser. I have the handler configured to open the PDF file. Now the problem is that, since we have the space in the name of the file, i can see and HTTP 404 error coming up in the browser.

HTTP Error 400.0 - Bad Request ASP.NET detected invalid characters in the URL.

 Am i missing any setting specific to IIS / ASP.NET ?

Thanks Tutu

View Complete Post

More Related Resource Links

Bitmap FromFile space "file not found"


I am using aspose.slides to create PPTx's. Some of the process involves loading jpg's from another server and including them in the presentation. This works fine in my development environment. When I upload the site to its server, the jpg loading fails.

I am trying to access jpg's on the other server by:

   oFS = New FileStream(sFile, FileMode.Open, FileAccess.Read)

This causes an access violation error when run from the server.

I also boiled the code down to reading the file directly:

   oImg = System.Drawing.Bitmap.FromFile(sFilePath)

This causes a file not found error.

We have narrowed the problem down to the fact that the File Path has a space in it. How does one solve this problem (while still keeping the space, there is a lot of legacy data)? I have tried replacing the space with %20 or +. I have tried using Server.UrlEncode. The error message always comes back with the encoding in place (like no decoding

i want to open vb.exe file from browser

when i click on button it is opened only on task baar not display on window

On click Dialog Box to browse file...NOt firing serverside event...

<script type="text/javascript">    function Open()    {         var fileupload=document.getElementById('fupload');                      fileupload.click();  //       document.form1.submit();    }       </script>protected void Page_Load(object sender, EventArgs e)    {btnimport.Attributes.Add("onclick", "javascript:return Open();");    }<asp:Button ID="btnimport" OnClick="btnimport_onclick" runat="server" Text="Import"/>                                                        <input type="file" runat="server" style="display: none" id="fupload" />protected void btnimport_onclick(object sender, EventArgs e)    {        if (ViewState["CurrentTable"] != nu

How to view AJAX-enabled WCF service (.svc) file in browser

Hi I have created an AJAX-enabled WCF project TestWCFAjax having Default.aspx that uses the Add.svc web service.  When I select Default.aspx and run the app in VS 2008. It works perfectly, calls the webservice to do the desired task. But, I have following questions: 1. When I select the Add.svc.cs and run through VS2008, it throws an error "The type 'TestWCFAjax.Add', provided as the Service attribute value in the ServiceHost directive could not be found.". And the web url on the browser points to http://localhost:4960/Add.svc. I didn't create any virtual directory. I tried creating one that points to my application folder - TestWCFAjax. Still it doesn't work. How can I view Add.svc service on the browser like what we can do with normal WCF service? 2. How can I use Add.svc (AJAX-enabled WCF Service) in another web application? Regards

File Rename Problem(Space Problem)

i create a web site for file file uploading and download      My File name is            Hello File1      But we download the file the name is changed in      Hello        

Closing the browser window before file streaming




I have the following requirement in one of the applications I am working.

In an aspx page, that gets opened in new window from a hyperlink that is clicked in the main application. The newly opened window contains a button and on clicking on that button, an Excel file gets streamed to the user for download. If the file is created successfully for streaming, the newly opened window where the button is there should be closed automatically, otherwise, the window should stay with errror message gets displayed.


Can any one suggest how can this be achieved in ASP.Net?


Thank you,


couldn't open a file extension .cert from browser


 There is a file with an extension .cert sitting on web server. when i tried to access it through URL, i couldn't open it and didn't give any error message also. I verified the file existence in that folder and also i could open it using notepad. Is there any MIME to be added to open this file?

Input type file-: Not getting full path in mozilla


Hi All

I am using Input type = File to get a file from Disk.

<input type=file id="ipFile">

But when i get the value of this i get a file name in Mozilla where as a complete path with file name in I.E.


In I.E. -: D:\bkp\css.txt

In Mozilla -: css.txt

I want to get the Full path in Mozilla too. 

Please help and advice

Creating a Fixed-Length, Flat File, Space-Filled file


I need to create a Fixed-Length, Flat File, Space-Filled file. This is what I did:

1. Created a stored procedure with the fields using SPACE(#) so all the fields are the correct lenght.

2. Made a report.

3. Saved the report as Excel.

4. Save the Excel as 'Formatted Text Space Delimited'.

There are so many steps involved that I am wondering if there is a better way to create such a file.

Any help would be appreciated.




Creating a Fixed-Length, Flat File, Space-Filled file


I need to create a Fixed-Length, Space-Filled flat file.

I have a SQL query that uses SPACE(#) to make the fields that correct size.

I tried using reporting services and exporting to excel and saving to .prn, but that does not work because the maximum width is 240 and I have 350 characters per line.

I am fresh out of ideas. Send help!!!

Thanks, Linda

Linda Fleming

Hyperlink button with file browse on infopath



We need to have a button on our Infopath Web Form that will prompt the user to browse for a file and this would add a link to the selected document.

We don't want to attach a file since the file is already someware on the Sharepoint site. The "Insert Hyperlink" control is out of the question, we don't want users to cut and paste the URL. We can't refer to a list to create a dropdown of the files since it can be on several lists.

I don't mind doing code behind, custom controls, rules or anything that can acheive this. I already have plenty of coding in the form anyway.

Thanks for any help.

secure javascript file on client browser


hi i want to secure my javascript file on client browser i dont know how to do it. any way to encrept the file and acess decrepted file. so no one can acess my file on browser.

Running out of Drive Space & Adding a 2nd File


(Not sure if the DB Engine forum is a better place for this q, but thought I'd start here first :)


SQL Server 2008, 64bit. 3 File groups (plus a log), each with one physicial file in the group. Each physcial file is on it's own drive. File group X has a file "X1" and is growing and dangerously close to running out of space on the drive. I added a second file ("X2") to the X filegroup on a different drive with plenty of space as follows:


I was under the impression that the files would grow equally in parallel... the 2nd file is still 100MB, but probably because X1 has not experienced growth yet. My question is... Am I in any danger since the X1 file may run out of space, or will the data automatically redirect over to the X2 file as needed?

file attachment control on infopath 2010 browser form, validating event not fired


If preview within InfoPath 2010, the validating event is fired. But After deploying the form to SharePoint 2010, the validating event does not fire.

Any ideas?


Blog: http://convergingpoint.blogspot.com/

HTTP Error 404.3 - Error when try to browse a svc file





I am running Vista 64 with Framework 3.5 SP1 and Visual Studio 2008 SP1 and IIS 7.0 installed and I am new in WCF.


Everything seemed to work OK until I tried to browse http://assetkit/AkServices/Service1.svc.


I have created in the host file an entry like this: assetkit. Created a new website in IIS and published the service, using Visual Studio 2008 to this website.


This is a very simple service, in fact the service is the initial template for a WCF Service Application created by Visual Studio. After creating the WCF Application I have published it the application to IIS 7.0 to test the deployment.


When I try to browse the url above I receive the following error:


Module StaticFileModule
Notification ExecuteRequestHandler
Handler StaticFile
Error Code 0x80070032

Not able to publish an infopath 2010 Web browser form mode, Invalid form template, .xsf file not ref


Hi, i am migrating a infopath 2007 form from a sharepoint 2007 site to infopath 2010 form for a sharepoint 2010 site. I used the design checker to verify the form template ,I got a invalid form template error. So I went to the Resource files tab under the developer section. I edited the context.xml to my current site. After this,the design checker gave no errors.

But when i tried to preview this form, I got an erro saying

"The form template contains files that are not referenced in the form definition (.xsf) file or are referenced more than once."

Can anybody tell me where I went wrong?

How can we download a song file and play it automatically with the native browser ?



      I want to open the songfile automatically with blackberry native music player ,upon clicking that link. I have searched almost all web , but i was not able to find a solution, how we can download and open a file with native medal player browser. All the code samples i got was in java.  Is there any code for doing that in asp.net ? Any alternative in html?  The <object> & <embedd> tags are not displaying in the browser when i run the project. So, i think it won't work ? Is there any possible solution for that.... Suppose the content type="audio/mp3" . can any one specify code for that ?

      When normal downloading, again Request Entity Too Large Error appears. It's not bcoz the file is large, Itz only 344 kb. Still its not working.Why is it so?

     Any help would be appreciated !

           Thanking All,


ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend