.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

Rename File on Harddisk???

Posted By:      Posted Date: September 06, 2010    Points: 0   Category :Windows Application
Hi,    I have around 1000 image file in One folder...out of that i have around 400 image file with filename which contains '&' and i have to remove or '&' or rename the filename.... i have to create small application for this scenario...How to do??? any idea?? abhi

View Complete Post

More Related Resource Links

FileStreamResult how to rename the output file?????

i have an action to return a pdf file in my controller,if the return file is for downloading, the following code can be used to modify filename successfully.HttpContext.Response.AddHeader("content-disposition", "attachment; filename=form.pdf");HOWEVER, i found that when the pdf file was returned to browser( rather than a pop up window to download), the filename always remain same as the action name! (when u right click file and try to save it on ur hard disk), i was wondering if there is a automatic way to rename the file rather than "right click" and "save as" manually.so  can anyone tell me how to rename the outputfile when it is shown in the browser?

Rename SPListItem file with extention

Hi guys,   I'm working with a simple workflow that is fired when a item has been added. workflow code is currenlty very simple..     Suppose that I upload original.doc. Following code will rename it to renamed.doc. I cannot find any way to rename "doc" extention to sth else.   Any ideas ? private void onWorkflowActivated1_Invoked(object sender, ExternalDataEventArgs e) { workflowProperties.Item["Name"] = "renamed.xml"; // .xml extention is ignored! workflowProperties.Item.SystemUpdate(); }  

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        

Rename Picture Library Image File Programmatically


Dear Experts and Forum Users,

I am stuck with renaming an image file type before it is actually saved to picture library. I am achieving this using a custom web part with file upload and a simple button control.

Please look at the code below (I have added comments so that it is easy for you to understand excactly what I am doing)

If FileUpload.HasFile Then
' Get extension of existing file
Dim ext as String = Path.GetExtension(FileUpload.PostedFile.FileName)
' Assign New Name - 'Test'
FileUpload.SaveAs(how to declare this path + "Test" + ext)
' Upload the Image to Picture Library
pictureLibraryList.RootFolder.Files.Add(FileUpload.FileName, streamImage)
' Finally Update the Picture Library
End If

Problems with this code

Firstly, it is not working because fileupload control method saveAs() and fileupload control method postedFile.saveAs() both require a rooted path in this case C:\inetput\images and not http:\\url\ some url pointing to picture library - how do I actually rename the file and also save it to the picture library ?

Please can you suggest a workaround for this.

Many Thanks,

How to rename a File


How to rename a file of .cs class file?

and it has to rename of the Namespace.RenameClass file like this...

How can i?


How to Copy the string data to a File?

In string i am getting the renaming value like Namespace.RenameClassfile.

Now only thing is copy to a file how???


Rename file having special characters when uploading to document library



i am trying to use the ItemAdding event handler to capture the filename and rename it when uploading. But it doesn't work.

Does anyone have any idea which event should i consider OR is there any other solution??


dynamically rename file name in ssis


I have source files in any format means text files,xml,word,excel...it really does not matter but i want to change all their file name and rename in below format in ssis

conastant|current date|current time|constant|constant. In this format fileName should be

ex. xyz2010-11-151:20:34256765.987

and every time i run the package it will change time and date dynamically.

I have little bit idea of using for each loop.

Need more help on that.

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.

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.

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

Transfering a file from Conputer to PDA

You can transfer one file at a time between your computer and another Bluetooth device by using the Bluetooth File Transfer Wizard. For example, you can transfer files between your computer and a mobile phone or a PDA. You can also transfer files between two computers that use Bluetooth.

The Free Barcode Creator produces barcode images one at a time, and allows easy saving to a file or

The Free Barcode Creator produces barcode images one at a time, and allows easy saving to a file or pasting into an application. 2D versions are also available:
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