Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Help Creating a Upload File Form.

  • This topic is empty.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #28947
    expo703
    Participant

    Upload Form keeps saying INCORRECT FUNCTION. When trying to Upload…
    This is what I have so far : http://www.promoteyourteam.com/Articles.asp?ID=143

    Article HTML:

    Code:
    Type (or select) Filename:


    PHP File on FTP:

    Code:


    Process Uploaded File


    The file has been successfully uploaded

    ‘;
    }
    else
    {
    switch ($_FILES[‘uploadFile’] [‘error’])
    { case 1:
    print ‘

    The file is bigger than this PHP installation allows

    ‘;
    break;
    case 2:
    print ‘

    The file is bigger than this form allows

    ‘;
    break;
    case 3:
    print ‘

    Only part of the file was uploaded

    ‘;
    break;
    case 4:
    print ‘

    No file was uploaded

    ‘;
    break;
    }
    }

    ?>

    #75285
    expo703
    Participant

    Can anyone help me with this?????????

    #75326
    Chris Coyier
    Keymaster

    Are you trying to use PHP on an ASP page? I’m not sure that works…

    Wufoo has simple file upload fields for their forms:
    http://wufoo.com

    This is also awesome, but ultimately relies on PHP also.
    http://www.uploadify.com/

    #75157
    noahgelman
    Participant

    How can you tell if the site is ASP?

    Just last week, we had a client who wanted to make an endless amount of changes ( darn you upper management *waves fist*). We had finally finished everything they wanted and so we went live. Moved the files from my site to theirs. Turns out they run ASP and none of our PHP worked. It was mass hysteria as we were working to do everything ASP compatible (as we were doing this they decided they wanted more changes).

    It was ridiculous. Anyways, back to the question (sorry for the rant, it was the most frustrating client ever), it would be nice to not have to go through this again. I could always ask the client but clients aren’t often too bright this stuff. Anyway to see what it is remotely?

    #75429
    Tcooper
    Member

    As long as the server that hosts the PHP file supports PHP it should work fine with the changes below:

    HTML form

    Code:
    Type (or select) Filename:


    PHP file

    Code:
    if (move_uploaded_file($_FILES[‘uploadFile’][‘tmp_name’], “uploads/”.$_FILES[‘uploadFile’][‘name’])) {
    print ‘

    The file has been successfully uploaded

    ‘;
    } else {
    switch ($_FILES[‘uploadFile’][‘error’]) {
    case 1:
    print ‘

    The file is bigger than this PHP installation allows

    ‘;
    break;
    case 2:
    print ‘

    The file is bigger than this form allows

    ‘;
    break;
    case 3:
    print ‘

    Only part of the file was uploaded

    ‘;
    break;
    case 4:
    print ‘

    No file was uploaded

    ‘;
    break;
    }
    }

    You need the enctype="multipart/form-data" attribute set on the form, and there were some syntax errors with your PHP.

    #75432
    expo703
    Participant

    Thanks for the responses/help… Yeah i updated the form and PHP it still says "incorrect function"..I’m assuming that the server doesn’t support PHP..I will find out..we are using Volusion CMS..I know they use .asp for dynamic pages..Is there any alternative way to setup a upload area for clients to upload artwork that doesn’t require PHP? I talked to volusion and they said there is no way around it I would have to create a FTP account and hand it to my clients… How is this not possible to have a simple upload feature on our website grrr?

    #75435
    Tcooper
    Member

    Well, you could write your form handler in ASP if you don’t have access to a PHP enabled server.

    #75436
    expo703
    Participant
    "Tcooper" wrote:
    Well, you could write your form handler in ASP if you don’t have access to a PHP enabled server.

    wish i new asp :D but I found this..

    Code:



    and created a upload.asp file

    Code:
    <% Set Upload = Server.CreateObject("Persits.Upload.1") ' Upload files Upload.OverwriteFiles = False ' Generate unique names Upload.SetMaxSize 1048576 ' Truncate files above 1MB Upload.Save "vvspfilesuploadart" ' Process all files received For Each File in Upload.Files ' Save in the database as blob File.ToDatabase "DSN=data;UID=sa;PWD=zzz;", _ "insert into mytable(blob) values(?)" ' Move to a different location File.Copy "vvspfilesuploadart" & File.ExtractFileName File.Delete Next ' Display description field Response.Write Upload.Form("Description") & "

    ‘ Display all selected categories
    For Each Item in Upload.Form
    If Item.Name = “Category” Then
    Response.Write Item.Value & “

    End If
    Next
    %>

    Still doesn’t work =/ just says Page can not be displayed..I dont get why it can’t be displayed its the correct location.

Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘Back End’ is closed to new topics and replies.