Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
|
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 23rd, 2011, 06:27 AM
Registered User
 
Join Date: May 2006
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default Adding Text to Image Uploaded to Folder

I am uploading images to a folder using asp FileUpload which works fine. But I need to add associated text with the file. So when downloaded say in a DataList it relates to the image. Ideally, I would like to upload more than a single entry. I have searched the obvious sites but can’t resolve the problem. Is it possible?

My upload VB code below.

Code:
Sub upAdd_Click(ByVal sender As Object, ByVal e As EventArgs) 
If (FileUpload1.HasFile) Then 
If (CheckFileType(FoleUpload1.FileName)) Then 
Dim filePath As String = "~/images/" & FileUpload1.FileName 
FileUpload1.SaveAs(MapPath(filePath)) 

End If 
End If 

End Sub 

Function CheckFileType(ByVal fileName As String) As Boolean 
Dim ext As String = Path.GetExtension(fileName) 
Select Case ext.ToLower() 
Case ".gif" 
Return True 
Case ".png" 
Return True 
Case ".jpg" 
Return True 
Case ".jpeg" 
Return True 
Case ".pdf" 
Return True 
Case ".doc" 
Return True 
Case ".xls" 
Return True 
Case Else 
lblError.Text = "Invalid File Extension" 
Return False 
End Select 

End Function





Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete image from Folder phuc2583 ASP.NET 3.5 Professionals 2 May 31st, 2010 10:20 PM
Convert Text(Sql Server Text Field) to Image(JPG) srinivas72 ADO.NET 2 February 13th, 2009 06:31 PM
How to save an image in a folder using c#.net2005 [email protected] C# 2005 1 October 31st, 2006 10:42 AM
Viewing uploaded .txt/.doc/image file ramesh055 ASP.NET 1.0 and 1.1 Professional 1 October 12th, 2006 02:07 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.