Code To Convert File Sizes
i have the following code that converts a file size into a readable format (10MB for example) to show to the user Code:
View Repliesi have the following code that converts a file size into a readable format (10MB for example) to show to the user Code:
View RepliesI've written an ASP file that queries a database and gets the full path to a database file, e.g.
"C:Program FilesMicrosoft SQL ServerMSSQLDatamyDatabase.mdf"
I've then used the Scripting.FileSystemObject to identify the size of the
file.
oFSO.GetFile(sPath).Size
It claims that the file does not exist....(when it definitely does!) I wondered whether this was to do with spaces in the file path, but I've proved that that is not the case. The EXACT code copied into a VB exe works fine. What's going on?
I know the code of a character is -12590, do you know how to convert to the character in ASP (It is a Chinese character in gb2312 format)? Or, do you know how to convert this -12590 to its unicode format 25105 without using gb2312-unicode table.
View Replies View RelatedI am having trouble with our server host they are saying that the php
upload limit is 20 mbs but using the code below with my flash file I
can only get it to do 8mbs. I know that asp is allowing for up to
20mbs though so I was hoping that someone would be able to change this
code to ASP(I am not very good at either php or asp). I think that
should be pretty easy:
<?php
if (is_uploaded_file($_FILES['Filedata']['tmp_name'])) {
$uploadDirectory = "uploads/";
$uploadFile = $uploadDirectory .
basename($_FILES['Filedata']['name']);
copy($_FILES['Filedata']['tmp_name'], $uploadFile);
}
?>
Can anyone help me convert the following php code to its asp equivalent? Code:
if(file_exists($file) && ($ext==".mp3"))
{
header("Content-Type: audio/mpeg3");
// open for binary read
$fh = fopen($file, "rb");
while (!feof($fh)) {
print (fread($fh, 10000));//filesize($file)));
}
fclose($fh);
}
else
{
print("ERORR: The file does not exist");
}
I have ASP project uses Access DB .. I need to convert the site into Mysql. But I keep getting some Runtime Error ( Mismatch ) and I don't know what the problem .. Code:
View Replies View RelatedI would like to know the page sizes of certain .asp ansd .aspx pages on the Internet. What I am doing now is go to the web site, right-click the mouse and click on Properties.
Some pages give the a lot of information: Page size, creation date, modification date etc. Some pages do not. How do I get this information from the pages that show it as "Not available"?
I want to Convert Excel Files to CSV files using ASP code CanAny body help me out in this.
View Replies View RelatedIn my pages i have to read a text file which is created in Unix format through my asp code. The problem is that the readline command reads the whole file and not line by line as the file is in Unix format. Is there a way to convert it using asp code and then read it or any other solution to this problem?
As the file is created by an application not controlled by myself it is impossible to force the application developer to do this job so i have to do it during runtime. So what are your suggestions?
I want to know, How to extract the content of an html file to Tab Delimited text file by ASP
(I want the code that do this)
How can i convert .aspx file in .exe file so that it can run on any
computer.
How to convert XML or HTML to pdf file ? Where can I find free pdf generator ?
View Replies View RelatedHow can i convert the .fxm(fax) file format to any of editable file formats such as Microsoft word or excel.
View Replies View RelatedI have a Physical path that I need to convert on the FLY I thought using Replace would be a good idea, and it almost works
function MapURL(path)
dim url2
'Convert a physical file path to a URL for hypertext links.
url2 = (path)
MapURL = Replace(url2, "", "/")
MapURL = Replace (url2,"E:","http://myscs/docLibraryDocs")
MapURL = Replace (url2, "IntranetLibrary", "")
end function %>
- Is it possible to have multiple replace on the same variable ?
- am I doing it the right way ? or is it possible to concatenate those replace in one go ?
Is there a limit on how many Replace one can use for one variable ?
The problem I have is that it takes the first two Replace in consideration but not the third one. If I remove or comment the second one then the First and the third one works fine. For some reason, it doesn't like to have the three in the same time.
by the way, the link I try to change is as follow: Code:
how to convert asp file output in excel dynamically.
View Replies View RelatedI've got a site managed in Frontpage and a forum in phpBB/MySQL. I'd like to grab the most recent posts from the Announcements Forum and embed them in the site's homepage. I got the idea from http://pocketpcthoughts.com/ . All of their homepage posts are fed from their FrontPage Archive Forums.
Right now, I'm using a phpBB mod called FetchAll to do the job. It works great except for one thing: I have to do it via an inline frame because I can't include a PHP file in an ASP page, and I have to use ASP because the site is in Frontpage (project requirement; FP is essential to the non-forum part of the site). Code:
I am uploading an excel sheet with .xls extension and want to convert it into .csv file so that it will be easy to read the data which can be inserted in database.
View Replies View RelatedI have written a classic ASP calendar that has been on my organization's website for a couple of years now, and it has worked fine.
I do all of my writing to files on my hard drive, then when the files are working properly, I upload the files to the server. Therefore, the files on my hard drive should be identical to the ones on the server. This has worked fine in the past - I have had two fully functional calendars, one on my hard drive, the other online. Until now, they both looked and worked identically.
Now, I'm trying to modify the main file, "calendar.asp". It no longer works, and the online copy still works flawlessly. When I looked at the local file (calendar.asp), all of the ASP code had been stripped from the file. Of course, the online copy is still intact and working.
The only editor I have used on these files is Notepad (actually, Notepad ++, an enhanced Notepad). I would understand if I had tried to edit the files with Frontpage (I'm using Frontpage to upload files to the server, but that's all I use it for), but these local files haven't been touched by Frontpage.
What Gives? How can a file selectively remove it's own code and disable itself??!!!
I try exporting the files from the server, and though the server files still have their ASP code, the browser can't find one of the include files, which is plainly in the same folder as the calendar.asp file. The file "adovbs.inc" is no longer reachable from my hard drive, even if I export ALL of the files in the "calendar" folder to my hard drive.
What can be hoseing up my local files, and how can I prevent it? Although I have downloaded ALL of the files from the online copy to my hard drive, why do the files behave differently than they do online? What kind of trickery is this?
I am writing a small CMS type system for our intranet at work and I am trying to have a main "index.asp" that does all the work in a template folder and every time I add a new section instead of making a new copy of this file I would like to have some generic "index.asp" file that is nearly empty that just calls the "template/index.asp" file and let's it do the work.
The way each page in the intranet works is by using the same asp file but by having a few configuration files in their directory that point it to different menus, titles etc.
Is there a way to load an asp file from another one? I tried creating an index.asp containing just <!-- #INCLUDE FILE="templates/index.asp"--> but it doesn't seem to do it.
I have a page for uploading files. I got the codes courtesy from Shadow Wizard's shadowuploader file which is posted online. as the asp upload is something new and i am not familiar with, anyway i tested the page to upload some files but there was an error displayed Error Type:
Microsoft VBScript runtime (0x800A004C)
Path not found
/shop/ShadowUploader.asp, line 283
it refers to this highlighted code in red. what does this error suggest. can anyone explain.
I'm coding a page where you can download a lot of different files( 100-1000) but I don't want to code each file(linking and all) it would take weeks to do that. I tried with a database and asp code rding the databse but it not saving a lot of time since I got to complete the databse.
I wanna know if we can code with asp something to automaticly read each file and list them in html so I dont have to code 1000 x the samee thing.
I want to put this code in all my asp programs. code'objrs.cursorlocation=adUseclient' in all my asp programs. i hve created around 30 asp programs but forgot to place this one.
So is there any way to write only this code(objrs.cursorlocation=adUseclient) in any program, and include this file in all this 30 programs using #include file.
In all 30 programs , i have written code
set objrs=server.CreateObject("adodb.recordset")
objrs.open strsql,objconn,3,3
we're running IIS 5 and trying to do a simple update to a code behind file (Login.aspx.vb) we copy the file over to the server, but we're not seeing the updates. the server is still reporting errors on line numbers in the file that no longer exist. we've even stopped / restarted the service, with no luck.
View Replies View RelatedCan anyone tell me where I can find some 'simple ASP File Upload code'? I've googled 'File Upload' but they all seem to be very involved with a lot of files. I'm still considered a novice when it comes to ASP.
View Replies View RelatedI have search the web last day all day and i did not find how to make a simple upload in APS not classes and third parties and don't know what .dll's that must be copyed on the server just 3-4 lines of code just like in PHP:
<input type="file" name="img">
$dir = "img/";
copy($img,$dir.$img) or die ("Error");
............
we have an Enterprise Application on ASP and MS SQL 2000. Would like to know if I can convert the asp app to an exe or encrypt / encode / hide the source code so that no one accessing the server can touch / modify / copy the same.
View Replies View RelatedI am looking for some code somewhere that is capable of getting information from a file submitted with the Form File tag and then uploading it to a remote server. Does anyoen know of anything?
View Replies View RelatedI have a multidimensional array that is actually 1 dimension (but it comes from a recordset.getrows). My goal is to put every single line of the recordset in a textfile.
currently, here is my code:
for i = 0 to UBound(Res,2)
fileContent = fileContent & res(0,i))
Next
createTxtFile(path,fileContent)
The problem is, I have 5000 lines and it takes about 10 minutes. I was thinking of doing a Array.Join but I don't think that works with multidimentional array. Also thinking of converting my useless multidimentional array into a sing dimensional array but how?
My page have background image,on that image have more images and text. My problem is whenever resize browser that images are not resized and also not moved correct place .(i.e look not like before alignment).I want to do everything in dyanamic....
View Replies View RelatedI'm looking for sample code that will require a use to enter a code from a scued image format.
I'm sure you've seen them before where the image is barely readable by a human and the user has to enter the code correctly to submit the form.
I'm looking for ASP code and NOT ASP.NET code as I am supporting a legacy site.
is it possible to convert asp.net coding into asp coding?i know out there, theres a software to convert asp code to asp.net.is there a software to convert asp.net code into asp code?
View Replies View RelatedI have a client that wants to send an invoice when a user submits a certain form on their site. From this form it goes to an asp page that calculates amounts, and check for a voucher. It then enters data in database and emails invoice.
But they want it send as a pdf attachment. How do i go about doing something like that. Do i convert the htm / asp to pdf. and send it?
<%
mysql="SELECT * from data"
Set con = SERVER.CREATEOBJECT("ADODB.Connection")
Set rs = SERVER.CREATeOBJECT("ADODB.recordset")
con.open "DSN=database4atc"
rs.open mysql, con
'recordset.open sqlcommand, activeconnection
%>
how to convert to dns less?