Randomly Generated Filename
How could I create a random filename for a single-use download? So, if a user was to download a file from a site it would send them a unique filename that could only be used once. That link would not be available after the download completed.
View Replies
ADVERTISEMENT
I used to have a piece of code that would generate a random string of
8,16,24 or 32 characters in length.
I got it from this group, does any one have this piece of code?
It will be used for a double opt-in email newsletter.
View Replies
View Related
I am relatively new to this generation of variables in ASP. I am unable to proceed from here. Can somebody advise?
Challenge :
I get number of participants in an exam, from a sql statement and stored into a variable called headcount.
After that, I am using the following to initialize randomly generated variables. For example if there are 4 students in the class, I intend to get student1, student2, student3 and student4, all of them initialized to 0.
For j=1 To CLng(headcount)
Eval Execute("student" & j & "=" & 0)
Next
Now we are trying to find out question wise defaults in the test. I have a for loop that does traverse through all the questions in the test. As I go question by question, if there is any failure I would like to increment the errorcounter of that participant.
Which means .....
View Replies
View Related
I would like to incorporate a Randomly Generated Validation Code Immage into my New Registration page (so when users register they have to enter a validation code produced by the immage).
View Replies
View Related
I have a form that gets a filename from a db like so
<FORM METHOD="POST" encType="multipart/form-data" ACTION="pic_delete.asp">
<input type="hidden" name="File1" value="<%=rstemp("filename")%>">
<input type="hidden" name="ImageID" value="<%=rstemp("ImageID")%>">
<INPUT TYPE=SUBMIT NAME="cmdSubmit" VALUE="Delete" ></form>
when I submit I get the error message "File not found"
So a did a respnse write to write my filename and found it is now called 2006_Apr_19-83955.23.bin It seems to be the time as it changes each time I try and get the filename to write...
this is the code on my delete page
<%
Dim Upload
Dim FileName
Dim Folder
Set Upload = New clsUpload
FileName = Upload("File1").FileName
response.write "Here is the file " & FileName & " name <br>"
Folder = Server.MapPath("..country") & "" & strPathToSave
response.write "Here is the folder " & folder & " name"
Upload.DeleteFile Folder & FileName
'Upload("File1").SaveAs Folder & FileName
Set Upload = Nothing %>
The folder name comes out right, just the filename changes.
View Replies
View Related
how can I do a "select" action and select lines randomly, for example:
"select * from items where views>100" and to choose from that 5 objects randomly.
View Replies
View Related
i need to choose a data, randomly, in a database based n category (cat1, cat2, cat3, cat4, cat5, cat6). i only need to show 1 data of each category in the html page. kindly inform where to find a sample tuts for this.
View Replies
View Related
I've got a csv file with names, addresses, emails, etc. I've been asked to randomly select a name from a csv file. I've found plenty of RandNum examples, but I'm not sure how to apply it to these names. Can anyone point out a sample I could use?
View Replies
View Related
I have a Windows 2003 Server Web running 5 web sites. Every few days, the ASP pages stop responding. There are no events in the event log. The HTML pages are still served successfully. These pages have no database interaction (others use MySQL). I have to restart IIS in order for the pages to work again. I haven't been able to find anything about this issue on the web. Has anyone seen this before? Any idea how to fix it?
View Replies
View Related
I want to select a random record from a table within my Access database, however I am running into problems. When the page is executed, it always shows the same record. Code:
View Replies
View Related
We have 2 copies of our web application - Development and Checkout. We have
noticed that when the QA quys go through our QA version, they will sometimes
find that pages are missing the banners. The banners are created by VI
using the themes and layouts.
All of the other theme/layout information is
fine, and both sites are using identical Site Diagrams. We have even tried
copying the site diagram over from development to QA again and recalculating
the site, and the banners stay missing. Can anyone tell me how to fix this
and what is happening?
View Replies
View Related
Is this do-able with ASP / VBscript?
-- I have a database with user records (name, photo, etc. etc.)
I want to use asp to generate (on the homepage) a series of 4 randomly selected 'user records' from the database -- say just the headshot photo or name from the database.
In addition to the recordset being randomly generated (i.e. our of about 50 records, only records 4, 18, 23 and 26 are displayed) I need to MAKE SURE they are not duplicated (i.e. out of the 50 records, records 4, 18, 23 and 23 -- where the last two are duplicates).
Is there a way I can pull this off and how do I go about it exactly?
View Replies
View Related
Windows 2000 Server SP3
IIS 5.0
NET FRAMEWORK 1.1 SP1
SessionState="InProc"
Antivirus deactivate
No changes on main files (web.config, machine.config, in)
No exist Active Directory (changes in ACL are not exist)
In machine.config LogLevel="All"
No events registered in Event Viewer.
aspnet_wp.exe not recycled never.
Scenario:
Web site accessed by multiple users at the same time. Some user data are
stored in a session variables. Randomly one user view data of another
user.
It ocurrs in two different machines.
What can be?
View Replies
View Related
I am trying to get an access random image script to simply update the content from a folder on my server...... Automaticlly without having to go into the database to add a the new image and location, i just want it to randomly select one. is this possible?
View Replies
View Related
what i want to do is to put 2 fields in my table , username and password
what iwant to do is to create a page that ask you to unter your username only ,and when u click submit the other page will add new record for the username u enter and will input a randomly alpha(letters and numbers) to yr password field , so how can do this random thing throw the asp"!?!
View Replies
View Related
I'm looking for a way to check if a directory has any filenames with 'w9' in it, and if so print 'yes' in the appropriate place. My database has a field called CustomFieldFilesDir where the appropriate folder structure is already entered for each person ex. 'p:john doe'. I've searched and found scripts that look at extensions but not the file names themselves.
View Replies
View Related
I’m trying to build an application that will flow like this “when the data from my form1 is submitted an auto increment is generated id will generated...I want to be able to used the generated id in other form or page in my application.. this is because the id would be use as foreign key in other table in the database” …is there anybody can guide me on these issue.. I manage to develop it only until the submission of the first form after that I didn’t know how to call the generated id.. For your information I’m using mysql as database.
View Replies
View Related
i have this form to upload a document to a folder on the server. i have a field where you browse the files on your computer to upload to the server. once that field is chosen i would like another field to be populated automatically with only the document's name, without the path extension on it. does anyone know how to go about doing this?
View Replies
View Related
My problem is: i need to write an ASP page which first checks whether
the user has permissions to download a ZIP file, and then streams the
file itself if the user is allowed to see it.
I have succeeded until
this point, but the client browser asks to save the file with the
original filename (and ASP extension). Obviously this would mean
making the downloaded file unusable at client side, unless I tell the
site user to manually rename it, but this is not a solution.
So I ask you: is there any way for an ASP page to stream data to the
browser and have it saved with a default file name and extension which
are different from the page's ones? Code:
View Replies
View Related
I want to have a form where there is a textfield and a Browse... button to the right of it. I want the user to be able to press the Browse... button and select a file and then that filename be returned to the textfield.
I don't want it to upload it or anything like that...I just want to know the filename that the user has selected. Also, when the user presses the Browse... button, I want it to automatically go to a certain place.
View Replies
View Related
I have an asp file upload facility on my website and I now want to add a timestamp to the name of each file uploaded to my webserver to ensure no clash of names.
I have no idea how to code it so egfile.txt will arrive on the server as egfileYYYYMMDDhhmmss.txt (or something similar).
Is it possible to do?
View Replies
View Related
What string function(s) would I use to extract just the filename from an URL?
For example, if I have http://www.yourdomain.com/some_directory/some_file.asp, how do I extract just the "some_file.asp"?
View Replies
View Related
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
View Related
I am storing URL in a database for a 'sort of' directory type website.The <a href> is built from the recordset of URL's which is all working no problem, easy stuff.What I have found is going to be necessary in some cases is to trim the URL back to just it's www.abc.co.uk address for the link display.
I still want the actual link to go to it's long 'deep linking' location, but there is limited room for displaying a URL that could be a hundred chars long.
View Replies
View Related
I'm making an error tracking system.I want to include a file (or function) at the top of each page which gets the A) current file name B) directory the file is in. In PHP this is $_SERVER( PHP_SELF )
On a side note, why is it that you can type "PHP SERVER FUNCTIONS" in google and get wonderful results, whereas "ASP SERVER FUNCTIONS" returns garbage?
View Replies
View Related
am trying to upload a file and at the time try to rename the file to autogenerated name.
View Replies
View Related
One of the things I do is do my testing on an alternate address, then store the file as the regular address after it tests correctly, but since I might mention the test page in various forums when I ask questions, I leave it uploaded just in case someone later sees the link and clicks it.
So far, my kludgy way of handling it is to have a variable called "thispage" and set it equal to the page I'm working on, so when it links to itself, it links back to the page in question.
Is there a way of automatically testing for this value instead of manually defining it? I tried a quick Google search, but I didn't know what to call it. I assume it might be in the same general collection as the HTTP_REFERER item.
View Replies
View Related
I coded a simple asp-script to force a file-download. (ex. dummy.doc). In IE6, NS4.7 and Opera 7 everything works fine and the file can be easily downloaded. But NS7 renames the filename in the dialogue-box to dummy.doc.asp . How can I prevent that?
View Replies
View Related
I have a page that writes a hyperlink to files in a folder, but the
hyperlink fails with the space in the filename. How can I strip out that
space or replace with ? Code:
View Replies
View Related
I have an ASP page that causes Excel to be loaded on the client PC with the text sent from within the page. An excerpt of it is shown below:
With Response
.ContentType = "application/vnd.ms-excel"
.Write(strResponse)
.Flush
.End
End With
where strResponse is the text to be displayed in Excel. This all works fine and as expected, but the only problem is that the file is opened in Excel on the client with a filename that reflects the page from which the information originated. Is there any way of specifying the filename using MIME, for example if I wanted the file to be loaded in Excel as "myfile.xls"?
View Replies
View Related
Can anyone provide me with, or point me in the direction of somewhere where I can get the code to get the server to create and send an email.
Basically, when an order is completed on my site, I need to create and send an email notification both to the client and also to ourselves.
Is there anything else I need to be aware of when dealing with this? Any help would be greatly appreciated.
View Replies
View Related
Im trying to send plain text emails to a japanese mobile phone.they use 3G in japan. However,one make of mobile phone can't read messages when the message is generated from two strings concatenated together.yes,i dont belive it either
e.g.
message = "Hi"
message = message & " Bye"
cannot be read on one type of mobile phone (giving invalid content error).
I've also tried message = message + " Bye" but that gives the same problem.This email can be read on all otehr types of phones. A single string can be read, but as soon as the string is ended and then started again,it breaks.
View Replies
View Related
Is there a way to automatically copy the filename of an uploaded file to a database field?
View Replies
View Related