473,756 Members | 1,818 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_fi le($_FILES['Filedata']['tmp_name'])) {

$uploadDirector y = "uploads/";
$uploadFile = $uploadDirector y .
basename($_FILE S['Filedata']['name']);

copy($_FILES['Filedata']['tmp_name'], $uploadFile);

}
?>

Aug 28 '07 #1
3 2640
Rabel wrote on 28 aug 2007 in microsoft.publi c.inetserver.as p.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_fi le($_FILES['Filedata']['tmp_name'])) {

$uploadDirector y = "uploads/";
$uploadFile = $uploadDirector y .
basename($_FILE S['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_fi le($_FILES['Filedata']['tmp_name'])) {
$uploadDirector y = "uploads/";
$uploadFile = $uploadDirector y .
basename($_FILE S['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...@worldof spack.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_fi le($_FILES['Filedata']['tmp_name'])) {
$uploadDirector y = "uploads/";
$uploadFile = $uploadDirector y .
basename($_FILE S['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.ScriptTi meout = 10000

Set Upload = Server.CreateOb ject("Persits.U pload.1")
Upload.logonuse r "", "h...7", "g....n"
Count = Upload.SaveVirt ual ("./uploads/temp/")
For Each File in Upload.Files
File.CopyVirtua l "./uploads/" & File.ExtractFil eName
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
13569
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
3306
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 buffer into the character pointer. The code looks like the following: #include <stdio.h> #include <stdlib.h> #include "stdafx.h" BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call,
1
2305
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
5546
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 converted to -0.382712.... i have worked this c++ code over which seems to be running fine. Need to convert the code in VB. please help me guys.
8
2609
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 this code working properly. This is not for a project or program I am just trying to ensure I know what I am doing before I actually write a usefull program (long ways away I know) Here is the code that I would like to execute: #include...
1
1781
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 converting the different datatypes. I'm no star in programming C++ and always have had problems with pointers. Help is greatly appreciated. Here's the code: BOOL EXAPI
2
1612
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 Windows-specific API, what other things do I need to consider? Any help is much appreciated. Aaron
2
1759
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' : cannot convert parameter 1 from 'const char *' to 'LPCWSTR' the code is as follows: #include "stdafx.h"
5
1563
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 - <% End If%>Logged in as: <b><%=Session("user")%></b> Thanks!
2
1440
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 selectedIndexProducts) { selectedProducts = ListBoxProducts.Items.Value; }
0
9456
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9275
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9872
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8713
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6534
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3805
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3358
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2666
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.