Help needed to convert an easy php code to asp

Discussion in 'ASP General' started by Rabel, Aug 28, 2007.

  1. Rabel

    Rabel Guest

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

    }
    ?>
     
    Rabel, Aug 28, 2007
    #1
    1. Advertising

  2. Rabel

    Evertjan. Guest

    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)
     
    Evertjan., Aug 28, 2007
    #2
    1. Advertising

  3. 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
     
    Daniel Crichton, Aug 29, 2007
    #3
  4. Rabel

    Rabel Guest

    On Aug 29, 10:07 am, "Daniel Crichton" <>
    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
    %>
     
    Rabel, Aug 31, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hazzard
    Replies:
    2
    Views:
    646
    Hazzard
    Apr 6, 2004
  2. Bruno Desthuilliers
    Replies:
    5
    Views:
    390
    Bruno Desthuilliers
    Aug 29, 2007
  3. Rajive Narain
    Replies:
    0
    Views:
    1,843
    Rajive Narain
    Sep 18, 2009
  4. Raymond Scheeren

    help convert php code to eruby

    Raymond Scheeren, Jul 7, 2009, in forum: Ruby
    Replies:
    0
    Views:
    108
    Raymond Scheeren
    Jul 7, 2009
  5. HUNT HUNT
    Replies:
    2
    Views:
    151
    Robert Klemme
    Mar 31, 2010
Loading...

Share This Page