|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Changing file nameHey all! Just a quick question. I have a site which allows users the ability to upload files by the HTML brows button control. My question is if a user submits a file,, and every file they submit I want my code to change the name of it.. So say the user submits 'Hello.txt'. When they press submit I want it to be changed to 'Hello1.txt'. I tried just changing the name but it stopped the file from working. Or also. what commands does one use to just change the name of a selected file on the local machine? Any help would be greatly appreciated. Thanx in Advance Chris Bonzol,
For the file upload it is very important what method you use on the Server side. There is no standard method for that. (Asp)Net has as least 2 classes for that, using those you can sure after the upload change the dataname or the file path (or Database) were you want to store it. Therefore show the serverpart so we see how you handle the input/file Cor Show quoteHide quote "Bonzol" <Bon***@hotmail.com> schreef in bericht news:1166502529.878917.257970@a3g2000cwd.googlegroups.com... > Vb.net 2003, Web application > Hey all! > > Just a quick question. > > I have a site which allows users the ability to upload files by the > HTML brows button control. > > My question is if a user submits a file,, and every file they submit I > want my code to change the name of it.. So say the user submits > 'Hello.txt'. When they press submit I want it to be changed to > 'Hello1.txt'. I tried just changing the name but it stopped the file > from working. Or also. what commands does one use to just change the > name of a selected file on the local machine? > > Any help would be greatly appreciated. > > Thanx in Advance > Chris > Not a solution again though Cor
Show quoteHide quote "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message news:OtFQW1yIHHA.780@TK2MSFTNGP03.phx.gbl... > Bonzol, > > For the file upload it is very important what method you use on the Server > side. > There is no standard method for that. > > (Asp)Net has as least 2 classes for that, using those you can sure after the > upload change the dataname or the file path (or Database) were you want to > store it. > > Therefore show the serverpart so we see how you handle the input/file > > Cor > > "Bonzol" <Bon***@hotmail.com> schreef in bericht > news:1166502529.878917.257970@a3g2000cwd.googlegroups.com... > > Vb.net 2003, Web application > > Hey all! > > > > Just a quick question. > > > > I have a site which allows users the ability to upload files by the > > HTML brows button control. > > > > My question is if a user submits a file,, and every file they submit I > > want my code to change the name of it.. So say the user submits > > 'Hello.txt'. When they press submit I want it to be changed to > > 'Hello1.txt'. I tried just changing the name but it stopped the file > > from working. Or also. what commands does one use to just change the > > name of a selected file on the local machine? > > > > Any help would be greatly appreciated. > > > > Thanx in Advance > > Chris > > > > Chris,
While I don't really have the programming skills necessary to actually whip out the code quickly, in pseudo-code the logic would run something like the following... If user uploads file then get the filename of the file check the data storage and get the total number of files uploaded by the user assign the upper bound of the data storage to a variable increment the variable by one split the filename at the "." into two temp variables concatenate the storage variable onto the end of temp1 variable and then... concatenate temp2 back onto the end of temp1 and assign that name to the file. VB.Net has many methods that I've been learning about recently that can do wonderful things and my little example may be a bit too verbose... or not verbose enough. :) I've actually been 'reading' through the help and checking out the methods and properties of methods along with the help I've been getting. Hope this helps you in some small way. Show quoteHide quote "Bonzol" <Bon***@hotmail.com> wrote in message news:1166502529.878917.257970@a3g2000cwd.googlegroups.com... > Vb.net 2003, Web application > Hey all! > > Just a quick question. > > I have a site which allows users the ability to upload files by the > HTML brows button control. > > My question is if a user submits a file,, and every file they submit I > want my code to change the name of it.. So say the user submits > 'Hello.txt'. When they press submit I want it to be changed to > 'Hello1.txt'. I tried just changing the name but it stopped the file > from working. Or also. what commands does one use to just change the > name of a selected file on the local machine? > > Any help would be greatly appreciated. > > Thanx in Advance > Chris >
business layer, data access layer , presentation layer for asp.net using C#.net
Convert OEM to Unicode Dynamically load a form Raising an event from a user control Determine if app fails... Inherited form Name from Base Detect Multiple Keystrokes? How to manage a exception in a Aplications Borderless Form Start Menu or Autorun.INF? |
|||||||||||||||||||||||