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

Post New Web Links

Return a file with bad headers?

Posted By:      Posted Date: August 24, 2010    Points: 0   Category :ASP.Net

I've build a MP4Handler. The Mp4 hander selects a correct file from a url.
The system works if you work with 'normal' mp4 files.

But the problem is the MP4 files are genrated by another program, so i think there's the problem.
Right now i returned a test file, then it woks great!

Do i return the other file, i get a 412 error if i use it in IE (he shows a  400 error because i deleted the 412 error in the IIS i thought maybe that solves the problem) . In IE it doesn't work, but in firefox it works great!

In my Fiddler result, the first movie (guid url) is from firefox, and works great. The second with the text/html result (selected row) is from IIS.
How can i solve this problem?

Or is this the problem?:
This entity tag is not recognized by IIS. It only affects version 7.0 of the IIS software.
From: http://www.pc-library.com/errors/error-code/412-0x19C/ 


As coding i use this as base: http://dotnetslackers.com/articles/aspnet/Range-Specific-Requests-in-ASP-NET.aspx 
I changed The GetRequestedFileInfo with:
public override FileInfo GetRequeste

View Complete Post

More Related Resource Links

How to return back back to code behind file after cascading dropdown calling

Hi, I have a cascading dropdown. After the dropdown is populated(it is in another file)  i would like to return back to the original form where the control is placed. is there anyway of doing it

Scan PDF file and return words


I've a problem while using ASP.

My situation is I want to convert every documents' contained words into database and upload those document to server.

For example: MS word, MS Power Point, MS Front Page and PDF files.

Those words needed to store into database and let others to search by content.

Thank You !

Search by file Name in advanced search does not return any results

Hi there ,when i search by file name it doesn't return any results . search by other columns return result.

WCF: Read file system image and return image thru wcf



I have a service which reads an image stored in the database. I want to be able to read an image stored on the file system and return that back to the requestor, is that possible?

Thanks for your help! :)


reading TXT file with (èàò) and return strange character

  Private Function Traduci(ByVal file As String)

    Dim testo As String = My.Computer.FileSystem.ReadAllText(file)

    Dim righe As String()
    righe = Split(testo, vbCrLf)

    For i As Integer = 0 To righe.Length - 1

  End Function<br/>

i am trying to read an TXT fiel with this function
in my example.txt i have this row:"pèpòàèpòàpèòp+p"

but the program returns": p?p???p??p??p+p"
is the charset the problem? if yes where can i set it?


call JavaScript that has Return Value to C# (.cs File)


hai guys...i got trouble with javascript , please help me up to solve this problem

i have a javascript to check is client file exist in the client folder like this : 

function FileExists(strURL) {
    var x = new ActiveXObject("Scripting.FileSystemObject");
    return  x.FileExists(strURL);

this function will call in server side , but im getting trouble how to call that function in server side , some function in cs will consume that js function before loading image , so that function will check in the client file the file exist or not , if exist i will load the image from the local file

please help me guys....thx for ur help

regards angela.

How to return WSDL file



Long story short, we are doing a WSDL first development, DotNet service/Java client. the WSDL does not specify the Soap Action. There is a work around for the service take requests without soapActions, but the problem is: the Dotnet service doesn't generate any WSDL type in its online wsdl file (when do query string type of inquery like in below sample). so the Java client can't generate proxy class.

I have a need for generating a custom wsdl file to the users when they look up the WCF service using wsdl query string:  e.g.:  http://namespace/service.svc?wsdl

Since we already have the WSDL for both serivce and clients, basically what I want the service do is: pick up the local wsdl file and return to the caller whenever they call the online ?wsdl

I have read so many post about extension points and I believe non of them serve my purpose. I want to have a short cut, i.e. a class instance/object that holds the WSDL file when the service was initiated.  then I just replace the wsdl file with the one read from the disk.

How can I do this?

Thanks  in advance!


File Splitter in .Net

I love to do utility programs in .Net. And this is one of them. As I was playing with JSplit (a free file splitter program), I wondered if I could do it in .Net. The framework supports file operations like reading files in bytes and creating them. It is indeed easy to do file operations in .Net Basics on File operations

Upload Multiple File using JQuery in asp.net

In this article I have explained how to upload multiple files using file upload control. I have used jQuery plugin for uploading multiple files.

I have also explained how to check for file type, file maximum size limit using jQuery & also using server side validation code.

Tooltip for GridView Column Headers (ASP.Net)

I just wanted to add auto tooltips for my GridView headers. There are couple of ways but I don't want to use javascript and wanted to use simple 'title' attribute. It took couple of hours to get the working code supporting sortable columns. I thought it will be very useful for others. Here's the code and logic behind it.

Creating Excel file from C#

I used below coding for create a excel sheet.I got from on web site.
In below coding there is no problem.Its create the excel file.If i run second time,its ask to overwrite the current excel file.If I said "Yes" then it ok ,but If I select cancel button,its generate the Error message.The exception is

Upload a File to a SharePoint Document Library - Part I

The following helper class demonstrates a few techniques that allow documents to be uploaded to a SharePoint document library programmatically without using the API or a custom web service. You don't need to specify a document library name, and it will create any folders specified in the URL as required. File meta data will be updated if any properties are passed.

SmtpClient and Locked File Attachments

Got a note a couple of days ago from a client using one of my generic routines that wraps SmtpClient. Apparently whenever a file has been attached to a message and emailed with SmtpClient the file remains locked after the message has been sent. Oddly this particular issue hasn't cropped up before for me although these routines are in use in a number of applications I've built.

How to call an .exe file in .net

Sometimes a developer has to call an EXE from another EXE. While calling EXE there can be a requirement to pass parameter.

Scrollable GridView with fixed headers in asp.net C# vb.net

In this example i am going to show how to create scrollable GridView with fixed headers which don''t get scrolled with records and stay on the top in asp.net using css, I''ve tested this code on IE7 and Firefox 2.0 , 3.5.

For this we need to add css to headers of gridview to keep them on the top.

First of all place a Panel on the aspx page from thetoolbox. Set height to 200px and width to 200px
and scrollbars to Vertical.
Now add a gridview inside this Panel and set the datasource to populate gridview.

ClientAccessPolicy file in SharePoint 2010

I am upgrading my Silverlight demo code from the old beta to beta 2 and see that there are a few new considerations for the deployment of ClientAccessPolicy.xml files. In a previous post I demonstrated how to do this for SharePoint 2007. The heartburn that I get with that approach is any site collection owner or designer can drag the file into the site collection and open the site up to unwanted client access issues. In 2010 the virtual path provider no longer serves the files from the root of the site collection

Multi File Upload Using JQuery!

Everyone knows about the file upload in .NET. But the multi file upload is some what difficult in .NET. For that purpose we can have some AJAX or JQuery!. Jquery is the latest advanced version. It will give some animated upload. You can try it for your own!!!!
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