altering uploaded files names

This is a discussion on "altering uploaded files names" within the Classic ASP section. This forum, and the thread "altering uploaded files names are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Mar 6th, 2006, 09:59
Junior Member
Join Date: Mar 2006
Location: uk
Age: 26
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
altering uploaded files names

Ive got a form that collects the users details (ie. first and last name) and lets them upload their cvs. is there anyway of altering the names of the files they upload by changing it to their name (so cv.doc would become joebloggs.doc).

heres the code that uploads the cv to the server:

<%
Set Upload = Server.CreateObject ("Persits.Upload.1")
Count = Upload.SaveVirtual ("/uploadedCVs/" )
response.redirect("session2.asp")
%>

currently if files with the same name are uploaded then the newer one would overwrite the existing file.

i was thinkin of using sessions to get the names but dont know how to change the file name.
Any ideas?

Ive solved this issue, the second line of code prevents the overwriting of files so that if cv.doc was uploaded twice, there would be the orignal and then there would be cv(1).doc.

<%
Set Upload = Server.CreateObject ("Persits.Upload.1")
Upload.OverwriteFiles = False
Count = Upload.SaveVirtual ("/uploadedCVs/" )
response.redirect("session2.asp")
%>

But now i have another problem. the upload function is incoporated into a form that send out an email but the form wont email with the (enctype="multipart/form-data") in the form and the file wont upload without it. any ideas?

Last edited by Gurpreet82; Mar 6th, 2006 at 11:18.
Reply With Quote

  #2 (permalink)  
Old Mar 7th, 2006, 01:26
Highly Reputable Member
Join Date: May 2005
Location: U.K
Age: 21
Posts: 739
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to benbramz
Re: altering uploaded files names

show us ur email code
Reply With Quote
Reply

Tags
altering, uploaded, files, names

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can multiple domain names point to the same HTML files? classic123 Web Page Design 3 Oct 30th, 2007 15:33
Rep Altering Power VanessaJW Webforumz Cafe 24 May 20th, 2007 18:39
Files names without spaces cyberseed Web Page Design 18 Dec 18th, 2006 19:16
Changes when uploaded pepe_starr Web Page Design 3 Mar 6th, 2006 21:33


All times are GMT. The time now is 20:57.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43