Forums
This topic is locked
Re-naming an image file
Posted 17 Apr 2006 18:27:05
1
has voted
17 Apr 2006 18:27:05 Dimitris Kouris posted:
Hi all, Happy ester holidays and lets hope the summers holidays will be here very soon!
So, I am using Pure ASP Upload 2 to upload my images on the server.
What I would like to do is to re-write the image name (e.g.myLogo.gif) with a unique randomly generated 9-digit number, so the "myLogo.gif" image become something like 123456789.gif.
Also, how can I make my content/text to appear on the site in paragraphs?
It seems to me that ASP somehow eliminates the breaks and paragraphs and the text on the page appears as a large piece of text with no brakes and/or paragraphs.
I use MS Access 2000 and the text area is being set to VIRTUAL.
Any tips or ideas?
Thanks in advance.
Replies
Replied 17 Apr 2006 19:51:18
17 Apr 2006 19:51:18 micah santos replied:
here's how to make your textarea contents in paragraphs.
<%
dim usrComment
usrComment = Request.Form("comment"
usrComment = Replace(usrComment, vbCrLf, "<br />" + vbCrLf)
%>
However, sorry I can't help you with your first question. I haven't tried using ASP Upload 2 scripts.
Hope this one helps.
<%
dim usrComment
usrComment = Request.Form("comment"
usrComment = Replace(usrComment, vbCrLf, "<br />" + vbCrLf)
%>
However, sorry I can't help you with your first question. I haven't tried using ASP Upload 2 scripts.
Hope this one helps.
Replied 27 Apr 2006 23:40:16
27 Apr 2006 23:40:16 Seb Adlington replied:
I Use this for renaming some PDF files
<%@LANGUAGE="JAVASCRIPT" %>
<%
var fso, f2 ;
fso = new ActiveXObject("Scripting.FileSystemObject"
f2 = fso.GetFile("C:\\Home\\g\\c\\gcs\\www\\pdf\\"+Request.QueryString("filename");
f2.Copy ("C:\\Home\\g\\c\\gcs\\www\\pdf\\"+Session("RNDNumber"+".pdf"
Response.Write("File renamed!"
%>
otherwise try googling "ActiveXObject("Scripting.FileSystemObject"" for some ideas
good luck
<%@LANGUAGE="JAVASCRIPT" %>
<%
var fso, f2 ;
fso = new ActiveXObject("Scripting.FileSystemObject"
f2 = fso.GetFile("C:\\Home\\g\\c\\gcs\\www\\pdf\\"+Request.QueryString("filename");
f2.Copy ("C:\\Home\\g\\c\\gcs\\www\\pdf\\"+Session("RNDNumber"+".pdf"
Response.Write("File renamed!"
%>
otherwise try googling "ActiveXObject("Scripting.FileSystemObject"" for some ideas
good luck