Finding Variable For Filename In ASP.net

I have tried 3'rd party .dll solutions, and nothing seems to work. (I tried to use aspsmart upload and could not get it to run properly, if you have gotten it to run maybe you could PM me? )

Anyhow for the time being I am using an ASP.net solution which uses the C# language I belive. Now the script works fine, but the only problem is that since I do not know much about asp.net and the included sub-languages I am at a loss as to attempt to record the filenames and store them in a Dbase.

The file is uploaded, then it responds by telling you "test.txt" has been uploaded successfully. But I cannot seem to find any way in which to isolate the part of the code that displays the filename(s), which means I cannot store them and submit them to a Dbase.

So, after all that horrible explaining here is the code which works flawlessly (at least on my system): Code:

View Replies


ADVERTISEMENT

Getting Filename From Form Then Deleting - Filename Is Changing!?!

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

Finding Age

I have a database with date of births stored dd/mm/yyyy (english dating
system) and =date() returns a date in the same format in my server.
how do i find the persons age using these two pieces of date.

View Replies View Related

If Filename Contains Then

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

Get Filename Out Of Pathname

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

Download Under A Different Filename

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

Retrieve FileName

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

Finding Word

i want to make a program to find out and highlight a particular word on the browser using ASP and javascript.

View Replies View Related

Finding A Path

Is there something similar to PHP's php_info command to tell me all about the server? I need to find the actual path where the site resides.

View Replies View Related

Finding The Webserver Name

I need to create a new application in our test server. I am using VID for
that purpose. In order to set up the project in VID, it asks me 'which server
you want to use'. However, I do not have the name of the test server. Is
there any way to configure the name of the server here? I have full rights to
the server directory and is mapped on my machine as G drive.

View Replies View Related

Add Timestamp To Filename

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

Extracting Filename From An URL

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

Here Is A Function For Finding Age

Here is a function where you don't have to worry about the leap year.

You will have to still be aware of time differences between you and
the server, and correct your data before entering it into the
function. And of course time zones, yada yada ....

BUT I think that most people using this will just want to say if today
is there bday than they are their new age. Code:

View Replies View Related

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 View Related

Trimming Filename

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

Path And Filename

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

Finding Version

How can I programatically ascertain what version of ASP my ISP has installed ?

View Replies View Related

Percentages Finding Of

I need help to find percentages, because I missed out on a lot of basic math education, I need it to be real clear step by step instruction for instance how would I go about finding 24 out of 32 one step at a time?

View Replies View Related

Finding A Port

i know how to find the available server names, how can i find the ports?

View Replies View Related

Filename Renaming In ASP

am trying to upload a file and at the time try to rename the file to autogenerated name.

View Replies View Related

Finding A Hotel

I am developing a hotel finder solution in Canada. When some one enters a Postal code, it should be able to display the hotels in 5 KM radius. (With nearer PIN numbers?) I am deleloping this application using ASP, and is there anyway I can such searches?

View Replies View Related

Finding The Space

I trying to find the memory occupied by the object in RAM, For Example:

Set ObjTest = Server.CreateObject("ADODB.RecordSet")

I need the space occupied by the ObjTest in RAM. Is it possible ?

View Replies View Related

Request The Filename

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

NS7 Renames Filename

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

Finding Max Value In Database

I am trying to find total number of parts in the database for a user by using the COUNT function:

max = HelpDesk.Execute("SELECT count(PartRef) AS 'maximum' FROM MISC_PartInfo WHERE Username = '" username "'")

but when i try to output the result by:

Response.Write max("maximum")

I get the error:

Item cannot be found in the collection corresponding to the requested name or ordinal./Intranet/test/PartInfo.asp, line 82

View Replies View Related

Finding Every Monday

if anyone can point me in the right direction or has code on this. i'm trying to display the number of occruances of an event during each week of a given month. basically, i'm looking for code that finds every monday of a given month.

View Replies View Related

Space In Filename

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 &nbsp; ? Code:

View Replies View Related

Finding No. Of Pages

one cant do a straight division because if i have 20 per page and 22 records, that's two pages. best i've come up with so far is

Code:

iPageCount = fix(iNumRecords / iPageSize)

if( iNumRecords mod iPageSize > 0 )then
iPageCount = iPageCount + 1
end if

anyone managed it better? is there a function like fix that forces a round up?

View Replies View Related

Specify Mime Filename

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

Finding Maximum Value

How do I find the maximum value of a recordset column? I'd rather do it this way than open a new recordset with Max(column).

View Replies View Related

Filename To Datbase Field

Is there a way to automatically copy the filename of an uploaded file to a database field?

View Replies View Related

Finding Element In Array

I'm creating an array from the querystring, then I want to find if something is in that array..

url = quiz.asp?done=6|3|4

done = Request.QueryString("done")

myArray = Split(done,"|")

For Each i In myArray
If myArray(i) = x Then
do something
End If
Next
I keep getting a "subscript out of range error"

View Replies View Related

Finding Out The Number Of Requests

I have a form. When I do action="POST" I can see the changes done by looking at ---- for example request("MyBox") 

Where MyBox is a dropdown box and by doing request("MyBox") I get the selected value.

Is there a way I can get the number of requests done? (i.e if I had 3 dropdown boxes then I get 3).

Also is there a way to get a list of the names of all the requests (i.e if I had 3 dropdown boxes then I get MyBox1 MyBox2 MyBox3)

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved