473,382 Members | 1,421 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

hello all i m ashutosh rath from mumbai working as a junior programmer in c#

i want to upload only zip files by c#, the format of file should be "ab_data.zip" format (start from 2 char thn one underscore thn after 4 chars)

my code is.......

string fileNameText = null;
string fileextension;
filename = Fileuploading.Value.ToString().Trim();

if (Fileuploading.PostedFile!=null)
{
if(Fileuploading.PostedFile.InputStream.Length > 0)
{
fileextension = Path.GetExtension(filename.ToString().ToLower()); if(fileextension != ".zip")
{
//error message;

}
else
{
fileNameText=filename.Substring(filename.LastIndex Of(directoryseperater)+1,filename.Length-(filename.LastIndexOf(directoryseperater)+ 1));
Fileuploading.PostedFile.SaveAs(Request.MapPath("/AspNetLearn/Upload")+ "//"+ fileNameText);
filepath = ("/AspNetLearn/Upload") + "/" + fileNameText ;
//message success;
}
}
}



plzzzz anyone help me...
Mar 25 '08 #1
0 716

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: mandar | last post by:
Dear Sir/Madam We have following openings with our clients in Mumbai. If you or any of your friends are interested, please mail your updated resume to us. Selected candidates will be taking...
13
by: BK | last post by:
Our .Net team has just inherited a junior programmer that we need to get up to speed as quickly as possible. Unfortunately, his skill set is largely Access with some VB6 and ASP classic...
1
by: 2Soft | last post by:
Dear All, Greetings from 2Soft Solutions! Find the opening position below & apply if your job profile matched with the same, else forward to your friends, colleagues etc. POSITION: PHP...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.