Ver Mensaje Individual
  #3 (permalink)  
Antiguo 03/04/2006, 08:47
Veronicalismar
 
Fecha de Ingreso: diciembre-2005
Mensajes: 131
Antigüedad: 19 años, 4 meses
Puntos: 0
De acuerdo Aqui tienes parte del codigo q t permite cambiar el nombre d la imagen

<%
'Sample file Field-SaveAs.asp
'Store extra upload info to a database
'and file contents to the disk
Server.ScriptTimeout = 5000

'Create upload form
'Using Huge-ASP file upload
'Dim Form: Set Form = Server.CreateObject("ScriptUtils.ASPForm")
'Using Pure-ASP file upload
Dim Form: Set Form = New ASPForm %>
<!--#INCLUDE file="_upload.asp"-->
<%

Server.ScriptTimeout = 1000
Form.SizeLimit = 10240*1024'10MB

'{b}Set the upload ID for this form.
'Progress bar window will receive the same ID.
if len(Request.QueryString("UploadID"))>0 then
Form.UploadID = Request.QueryString("UploadID")'{/b}
end if
'was the Form successfully received?
Const fsCompletted = 0

If Form.State = fsCompletted Then 'Completted
Const VirtualFolder = "pics1"

'Create destination path+filename for the source file.
'Create an URL for image.
Dim DestinationPath, virtDestinationPath
DestinationPath = Server.mapPath(VirtualFolder) & "\"
virtDestinationPath = "http://" + Request.ServerVariables("SERVER_NAME") _
+ GetPath(Request.ServerVariables("SCRIPT_NAME") ) _
+ "/" + VirtualFolder + "/"

'Open recordset to store uploaded data
Dim RS: Set RS = OpenUploadRS
Dim FileField

Dim DestinationFileName
For Each FileField in Form.Files.Items
'Fo each file sent
if len(FileField.FileName)> 0 then 'File is specified.

'LA VALIDACION LA COLOQUE AQUI
If Right(FileField.FileName,4) <> ".jpg" or Right(FileField.FileName,4) = ".JPG" then
response.redirect"registrate.asp?msg=5"
End If

'Dim DestinationFileName
'OJOOOOOOOOOOOOOOOOOOOOOOOOOOOOO
'DestinationFileName = DestinationPath & FileField.FileName SUSTITUIDO POR:
`AQUI ES DONDE COLOCAS EL CAMPO POR EL CUAL QUIERAS Q SEA CAMBIADO EL NOMBRE D LA IMAGEN AL SUBIRLO EN LA CARPETA QUE CREASTES
DestinationFileName = DestinationPath & Form.Texts.Item("telefono2") & ".jpg"
d1=Form("File1").FileName
' d2=Form("File2").FileName
'd3=Form("File3").FileName
'Save file to physical location
FileField.SaveAs DestinationFileName