Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

input type="file" problem

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I am trying to make a form so that user can put details of an image into a database. Instead
of typing image name eg: "swim.jpg". I want to let user browse for the image so that
spelling can be correct and for ease of use. The problem is that I want only the image name
"swim.jpg" to be placed into the database instead of "C:\album\images\swim.jpg". The image
will be later called up to be displayed in webpage. The image names are of various lengths but the place where they kept will be the same.
 
Hi JeArc,

View my VBS FILE UPLOAD posting.. edit the code so it does not save the file.. but you can get the file name.

Cheers,

Gorkem.
 
If you only want the file name and not the directory name then split the complete path of the file-textbox using the Split() function and on the basis of "/" character. Then take the last token. this will give you only the name of the file along with its extension.
 
I believe the FileSystemObject will do that. I can't access
Dim Fs
set fs = Server.CreateObject("Scripting.FileSystemObject")

strFilename = fs.GetFilename(strPathandFilename) Forms/Controls Resizing/Tabbing Control
Compare Code (Text)
Generate Sort Class in VB or VBScript
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top