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"
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.
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?
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:
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.
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?
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?
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.
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?
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.
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?
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:
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"?
i am trying to upload files to a webserver. When i send the file of any .ext i want the filename to contain the filename and date&time in the filename filenamedatetime.xxx the following is my code piece to send the file:
If FileName <> "" Then FileName = Mid(Filename,InstrRev(FileName, "")+1) set fso = Server.CreateObject("Scripting.Filesystemobject") set fle = fso.CreateTextFile(server.MapPath(FileName)) ' write the data fle.write DataString fle.close
I'm uploading a file to my server, and I retrieve the filename. Now I can print out the filename with response.write(filename) but when I try to insert the filename into access I get a "cannot be a zero-length string." error. I'm assuming its because the filename was read in using binaryread. So how would I convert this back into a string?
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.
I'm using the following method to retrieve the filname from a full server path:
<% sub getfname(strPath) Dim fName fName = Mid(strPath,InStrRev(strPath,"")+1) 'fName = strPath Response.Write( fName ) end sub %>
However this only works on Windows systems as it checks for backslash. Is there a more generic way to do this, or should I check for both backslash and slash in the path?
I need to browse filenames in a directory and insert them into my sql table. I want to run this in an ASP page. I know how to connect to the database, etc. I just need the script on how to get the filenames.
IIS 6.0 ftp will replace unicode filename with '^'. If i have two unicode filename on the server, both will display as ^.txt, which after download to my local drive, it will overwrite one another. I have no control over the filename my visitors use.
I try to do some search in ASP using the filename on an Index server Catalog. The filename begin with date (2001_06_13.html). I do some search with < and > and it work fine but when I do something like "@filename LIKE '%2001%'" it return anything. I tried this query alone without any query and it did the same thing.
With all the test I made I think @filename doesn't work with LIKE. How can I do search with wildcard with the filename? I use Windows 2000 server. have an other trouble. When I try to sort by filename sometime it work sometime it don't. Somebody know some issue about that?
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:
I have a problem with AspUpload. It's about sending the file name to my database. First of all I don't know the exact amount to post, so, I did a little function for this. The amount is between 1-20. In my database I have fields named 1-20, and text fields for the text to the files that is named "text1-20". My code:
I have an asp page that produces output from a database. This allows a simple way for the user to save the data to a text file by going to File->Save as...
The default save as options always defaults to a particular filename and the save as type is always html, therefore the user has to manually type a filename and choose Text File (*.txt) as the type.
I remember I was able to overide ride these options with the following code.
I need to change the filename of a file that users on my site can upload manually. I want to make the system work so that it changes the file name into a unique id.
The field in the table is an autoincrement int field so i'm thinking about just making it take the last number in the table and adding 1 . So basically, in this script, I want to take the filename of the user uploaded content and change it to the next number in the field with whatever extension. Here's my script...