473,396 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Help needed to convert an easy php code to asp

I 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);

}
?>

Aug 28 '07 #1
3 2626
Rabel wrote on 28 aug 2007 in microsoft.public.inetserver.asp.general:
I 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);

}
?>
Most of us asp people don't know what this code does,
so please elaborate on your Q.
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Aug 28 '07 #2
Rabel wrote on Tue, 28 Aug 2007 14:53:07 -0700:
I 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);
}
?>
Fixing the PHP to work is likely going to simpler - ASP doesn't have a
simple upload file handler builtin, it requires either messing with raw
binary data or a 3rd party component. I'd suggest you try posting in a PHP
related group - it's probably as simple as editing the php.ini file to
adjust the maximum upload file size, or there might be a limit somewhere
else in the PHP application. As the default in many PHP settings is 8MB,
adjusting your php.ini is probably the easy solution - just look for the
post_max_size and upload_max_size values.

Dan
Aug 29 '07 #3
On Aug 29, 10:07 am, "Daniel Crichton" <msn...@worldofspack.com>
wrote:
Rabel wrote on Tue, 28 Aug 2007 14:53:07 -0700:
I 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);
}
?>

Fixing the PHP to work is likely going to simpler - ASP doesn't have a
simple upload file handler builtin, it requires either messing with raw
binary data or a 3rd party component. I'd suggest you try posting in a PHP
related group - it's probably as simple as editing the php.ini file to
adjust the maximum upload file size, or there might be a limit somewhere
else in the PHP application. As the default in many PHP settings is 8MB,
adjusting your php.ini is probably the easy solution - just look for the
post_max_size and upload_max_size values.

Dan
Thanks guys for your help - Dan I have tried everything with our host
and just kept getting problems I knew that the asp upload feature we
had in another section worked so I converted that code and got that to
work

<%
Server.ScriptTimeout = 10000

Set Upload = Server.CreateObject("Persits.Upload.1")
Upload.logonuser "", "h...7", "g....n"
Count = Upload.SaveVirtual ("./uploads/temp/")
For Each File in Upload.Files
File.CopyVirtual "./uploads/" & File.ExtractFileName
File.Delete ' delete from upload directory
Next
%>

Aug 31 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

26
by: sam | last post by:
Hi, Can anyone help me find a software that can convert a code in 'C' to 'Fortran77/90' automatically? Thanks in advance. Sam.
7
by: Timothy Shih | last post by:
Hi, I am trying to figure out how to use unmanaged code using P/Invoke. I wrote a simple function which takes in 2 buffers (one a byte buffer, one a char buffer) and copies the contents of the byte...
1
by: Mark Hollander | last post by:
Hi All, Could you please help me convert this code so that it will run in VB.NET Thank You Mark Hollander Private Type USER_INFO Name As String
4
by: mirangk | last post by:
Heyy Guys... Im very new to vb. Im using vb6 and i want to convert a 32 bit ieee 754 number into a floating point number. for example. 'BE C3 F2 DF' (in hexa representation) should be...
8
by: hammb | last post by:
I am new to c++ (Visual C++ 6.0) and I am having some trouble getting this code to work properly. I come from a very different style of coding which is nothing like c or c++. Please help me get...
1
by: danmilkman | last post by:
Hi Y'all Can someone help me convert the next few lines of code from c++ to c#? I've given it a try myself but my program keeps crashing when I use my c# code. I think the difficulty lies in...
2
by: ayeung | last post by:
Hi, I'm trying to port some C++ code for an embedded control system running on Windows CE to Linux and I'm not sure where to start. Can someone please point me in the right direction? Apart from...
2
by: flavourofbru | last post by:
Hi all, I am presently working with folder and would like to find out the number of files in that particular directory. But I am getting the following error: error C2664: 'FindFirstFileW' :...
5
Eleven
by: Eleven | last post by:
Hi, Can someone please help me convert this code snippet from VB to C# <% If Session("PartnerLoggedIn") Then %>Partner User logged in: <b><%=Session("PartnerUserName")%></b> - on behalf of - <%...
2
by: staeri | last post by:
I need help converting the following code from C# to VB: int selectedIndexProducts = ListBoxProducts.GetSelectedIndices(); string selectedProducts = new string; int i = 0; foreach (int var in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.