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

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

How long will it be marked as New for an uploaded file?

Posted By:      Posted Date: September 02, 2010    Points: 0   Category :SharePoint
Hi there, A simple question: how long will it be marked as new when a file is uploaded or created to a library? Thanks.  allan

View Complete Post

More Related Resource Links

Cannot read stream from uploaded file

I have a file upload which uploads a file and gets read into a byte array.int FileLength = File1.PostedFile.ContentLength; if (File1.PostedFile != null && File1.HasFile) { Stream fStream = File1.PostedFile.InputStream; byte[] contents = new byte[fStream.Length]; fStream.Read(contents, 0, (int)fStream.Length); fStream.Close(); fStream.Dispose(); The problem is, the fStream.Read seems to have a problem reading the stream. When I debug it, and the value of "contents" appears to be empty. The file gets uploaded as a corrupted file.  

specified file or folder name is too long

Hi, We have MOSS 2007 SP1 databases on SQL Server 2005 SP3. All are 64 bit. We are intermittingly seeing the below  message in ULS log.: 09/01/2010 07:07:16.34 w3wp.exe (0x14BC)                       0x0D14 Windows SharePoint Services   General                                       8kh7      High       The specified file or folder name is too long. The URL path for all files and folders must be 260 characters or less (and no more than 128 characters for any single file or folder name in the URL). Please type a shorter file or folder name   But I'm unable to find the root cause that is causing this issue. I want to find which particular document or process or url is  cauisng this error? Where can I get that info? Whenever we see the above message in ULS logs, we are also experiencing blocking in SQL Server and users are facing very slow performance. Please advice Thanks

How can i delete the file uploaded in my web page?

 Hi Experts. I am writing a simple web page that  users can upload an image file. After the file is uploaded, Users can fill up  other question in the web page. then users click the submit button to register them and the file is uploaded previously is move to special folder and is saved there. Know i want to delete the uploaded file if the user upload the file but dont click the submit button and close the web page. because i dont need the file uploaded until the user is not registered. I use Session_End event but i dont know why it dont work. With Regards. Mojtaba

uploading a file with wcf works fine with local drive, but only 4096 kb uploaded when I use unc stor

Hello I'm writing a wcf service for uploading files to a server. It works fine when I try to upload the file to the servers local c:/ drive, but if I use a UNC path only 4096 kb is stored. It actually looks like part of the file is lost while storing it with writeStream.Write(buffer, 0, bytesRead);, because I wrote the bytesread to an sql table and the number of elements are always the same no matter how many times I upload the file, but the stored file is always different sizes, ranging from 1996 kb to 4092 kb.   I'm using IIS 7.5 on a windows 7 enterprise machine. My IIS is using a administrator account for the application pool, so it should not be a problem with permissions.   My wcf method uses Stream to upload the file in chunks    public void UploadFile(RemoteFileInfo request)         { //some methods to set the filepath                                   int chunkSize = 4096;                                 byte[] buffer = new byte[chunkSize];                                 Stream writeStream = new FileStream(filePath, FileMode.CreateNew, FileAccess.Write);  &

Delete file Asyncronously that is uploaded by AsyncUploader



Suppose after Uploading file,i want to delete a particular file ,for that i have added a link, that calls a Web Service method to delete file stored in DataBase. That link is added throug JavaScript in OnClientUploadComplete JavaScript function. And this Delete link calls another JavaScript function that in turn calls Web Service method. But that delete link should contain some specified arguments against which file has to be deleted. I am confused how to pass that argument to dynamically created Link.

Please help

update datalist in updatepanel after asyncfileupload has uploaded a new file


I want to update an updatepanel after the user has uploaded a photo via the asynfileupload control.

Below is my current code. I also tried setting updatemode="conditional" to "false" and then in code-behind call upnlPhotos.update, but without luck...

Upload photo: <cc1:AsyncFileUpload ID="afuPhoto" runat="server" /><br />

<asp:UpdatePanel ID="upnlPhotos" runat="server">

    <asp:DataList ID="dlPhotos" DataSourceID="dsPhotos" DataKeyField="id" RepeatColumns="5" RepeatDirection="Horizontal" GridLines="None" runat="server" >
        <img alt="" src='/images/trouwlocatiefotos/thumbs/<%# Eval("locpath")%>' /><br />            

    <asp:SqlDataSource ID="dsPhotos" SelectCommand="SELECT id,locationid,locpath from location_photos lp where locationid=@locationid" ConnectionString="<%$ConnectionStr

Client Side Code added to a file .txt when uploaded - FileUpload, VB.net



im tryin to upload files to the database using the FileUpload. the upload take place. when i download the file again ( word document, excel document.. a text document (.txt), a winzip file) , it turns that the file is corrupted and cannot be opened.. an image file or an mp3 file doesnt present this problem.

my application is developped usin vb.net 2010 and sql server 2005 as the database.. 

i searched the internet and the forums here but ive couldnt find an answer of what is happening wiz me..

ill present here the upload function and the download function.. plz help.

Protected Sub btn_upload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btn_upload.Click
        If Me.file_upload_case.HasFile = True Then
            Dim contentType As String = file_upload_case.PostedFile.ContentType
            Dim fileData As Byte() = New Byte(file_upload_case.PostedFile.InputStream.Length) {}

            file_upload_case.PostedFile.InputStream.Read(fileData, 0, fileData.Length)
            Dim originalName As String = Path.GetFileName(file_upload_case.PostedFile.FileName)

            Dim u As New UploadFileC
            u.CaseBranchP = Me.combo_branch_code.SelectedValue.ToString
            u.CaseIDP = Convert.ToInt64(Me.txt_case_number.Text)

long input file name validation


I am working on a data migration project, where data is getting transfered from csv file to sql tables using ssis package.

Should there be any restriction on number of characters for the input csv file name. If I concatenate the file names with date time, file name will have more than 50-60 characters. Why I am saying so, because at one place I am doing file name validation.

Can u plz provide ur suggestions? 


csv file uploaded but cannot be imported into sql


hi, I want to upload csv file and import the data into sql. but I cant do the import thing. The file is uploaded but it cannot be imported into sql. This is my code. Hope that someone can tell me what is the problem.

protected void Button4_Click(object sender, EventArgs e)
        string filePath = FileUpload1.PostedFile.FileName;
        string filename = Path.GetFileName(filePath);
        string ext = Path.GetExtension(filename);
        string contenttype = String.Empty;

        switch (ext)
            case ".xls":
                contenttype = "application/vnd.ms-excel";
            case ".xlsx":
                contenttype = "application/vnd.ms-excel";
            case ".csv":
                contenttype = "application/vnd.ms-excel";
        if (contenttype != String.Empty)

            Stream fs = FileUpload1.PostedFile.InputStream;
            BinaryReader br = new BinaryReader(fs);
            Byte[] bytes = br.ReadBytes((Int32)fs.Length);

            //insert the file into database
            string strQuery = "insert into tblFiles(Name, ContentType, Data)" +
               " values (@Name, @ContentType, @Data)";

How to manage lots of Uploaded file..


Hello All Forum members

I Gyan Need help in my current project work.

I am developing a job portal for a company who is operation in mumbai.

I wil have a functionality  that job seeker can upload their resume. I want to know that what is the best way to manage those uploaded file so that my application will no go down by performance.


Get URI of uploaded file by FileUpload control


Hello, i'me developing an ASP.NET application and it includes a FileUpload control, an object to show content of a format and a button to do functions. I want that when I upload the file, it will be shown in the object and for this reason i want to know the method to get the URL of the uploaded file.

This is the code:

if (FileUpload1.HasFile)
            FileUpload1.PostedFile.SaveAs(path + FileUpload1.FileName);
            play.Attributes["src"] =     // here is where will be indicated the url

Best regards

260 Characters in File Path - Too long


I have a Windows Service that is getting cought up on file paths that are longer than 260 characters.  I have googled just about every combination of this problem I can think of as well as various other forums.  From what I have read, Windows System.IO has a limitation on file paths of 260 characters or less.  However Microsoft's latest release of Robocopy has support for 260+ characters.  I have also read that a couple people mentioned unicode file paths which support up to 32,000.  The limitation is set with the MAX_PATH and internet explorer and Robocopy use unicode filepaths to save long files.

My workaround right now is to trap and skip the folders while I would like in the future to be able to have paths longer than 260 characters.  This right now is the ONLY work around, so the obvious "why dont you just move the folders?" response is out of the question.

My question is: Is there a way to use unicode file paths with the FileInfo class?  Perhaps using PInvoke?  Can you give an example for me?

Event Type: Error
Event Source: File Mirroring Service
Event Category: None
Event ID: 0
Date:  8/9/2005
Time:  8:42:28 AM
User:  N/A
An error occured:
The path is too long after being

Howto manage and save file sharing (uploaded file from clients)?



Howto manage and save file sharing (uploaded file from clients)?


a client is uploading files, where to save them?

should it be 1 folder for all clients uploding files? or should I open a new folder for each client?


what about file name?

if he upload a file with same filename? so when I'm saving the file name I should save int in a unique name?

and if I changed the file name to unique one so when the client wants to see hes file list and download all 

I should rename them back?


What to do?

How to manage it?



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.

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
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