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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

RENAME FILES ON THE FLY

Status
Not open for further replies.

gsc123

Programmer
Jan 24, 2008
197
Hello,

I would like to insert a form in this loop so i can rename the files has they list
for each file in f.files
str = str & "<TD><A href="" &" "" target=blank><IMG title="&file.name &" height="&sizeimg&" src="" &" "" width="&sizeimg&"></A></TD>" &VBCrlf
if i = width then
str = str & "</TR>" &VBCrlf
i=0
end if
i = i + 1
next
 
Do you want to send a new form to the browser for each time through the loop?

Or do you want one big form with a method for renaming each file?


Or do you want a just a big list of all the files, and each item in the list is a URL link to a rename page, where you click the old filename, visit the rename page, do the rename, then return to the list of all files.

That last option is probably the best.
 
would be nice one at a time, I then view the thumbnail and rename
 
I suppose one big form would do really?
 
I finished this off my self, few teething bugs if you can spot any but works


if Request.Querystring("update")= "yes" then
'update files
%><a href="rename.asp">home</a><%
for each file in f.files
j = j + 1
file.name = Request.Form(j)&".jpg"
Response.write "<BR>"&file.name
next
else
str = "<TABLE>" &VBCrlf
str = str & " <TBODY>" &VBCrlf
str = str & "<TR>" &VBCrlf


%><a href="rename.asp">home</a><br>
<form method="post" name="files" action="rename.asp?update=yes"><%
for each file in f.files
j = j + 1
str = "<TD><A href="" &" "" target=blank><IMG title="&file.name &" height="&sizeimg&" src="" &" "" width="&sizeimg&"></A></TD></tr>" &VBCrlf
%><input type="text" name="<%=j%>" value="<%=Replace(file.name,".jpg","")%>"><%=str%><br><%
i = i + 1
next
%><input type="submit" name="Modify"></form><%

str = str & "</TBODY></TABLE>"
'response.write str
end if
 
Just the one bug in this somewhere, renames a file Submit Query every second time round? just one file, the first named file, any offers why?
 
3RD one down it does not want to rename .. changes back to submit query?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top