Randomise A Filename's Name
I've created an upload application that allows a user to upload a file a space on the web server.
What I want is when a user selects the file to upload, when the upload process takes places, a random number is generated and added to that filename.
I work out I can add the code:
intrandomnumber = Int((1000000-1+1)*Rnd+1)
but how do you do the change to the filename when it uploaded as I can change the filename name but the physical filename name would be the filename held on the user PC?
View Replies
Is it possible to read the all filenames from a directory? Basically I want to grab all the filenames from a directory and make a flat file with all the values in it.
View Replies
View Related
I am developing a school Intranet and have an ASP page that allows students to upload files to the server for marking by teachers.
Unfortunately students often do not identify themselves correctly in the work they submit, so I am trying to find code that changes the name of the file they upload, by adding the their login name. (the the server variable AUTH_USER.)
AUTH_USER is easy to get but to perform the concatenation has me stumped.
View Replies
View Related
I'm using the input File method for users to upload their files to a folder on a website, I wanted to store the filename in the database but the information that is produced from the input File is an absolute path to the file on the users system (ie. c:/usersfolder/usersfile.doc)
where as I only want the filename (usersfile.doc). I am presuming that this is going to be a Split method but is there a decent place to find a tutorial on this. I've had a good google but can't seem to find anything.
View Replies
View Related
I must have about 300 images I intend to manually type into a database. Aaaaargh! I was hoping someone might be able to give me a script that if I were to place all the files on a server, I could access the directory, and loop through each of the files, storing the name in a field... Can it be done?
View Replies
View Related
I would like to read the contents of folder and display filtered results in my page.
View Replies
View Related
I've used asp upload before to upload single files to my server and write the name of the file to a database. I'm now trying to upload two files and write each file name to a different field in a record.
Currently my code says: ....
View Replies
View Related
i use this script to generate download links from directories which are first passed to an script to record the number a link is clicked.
the function is calle with a path like:
ListFolderContents(Server.MapPath("/dir1"))
my question now is: can i write this to an multidimensional array (or object oriented?) - and then sort it by date ?? if so how ? Code:
View Replies
View Related
I'm writing a shopping cart system, and the item listings have thumbnails along the left side, kind-of like the layout of eBay. This works fine and dandy unless the filename happens to have a space in it. When there's a space, the Url ends where the space is. I tried using the replace function, but to no avail. I tried ItemPic=(replace(ItemPic," ","%20")
However, the filename then becomes something like Cool%2520Item.jpg instead of Cool%20Item like it needs to be. If anyone has a solution other than going through about 10000 pictures and renaming the ones with spaces on how to make this work. Code:
View Replies
View Related