- This topic is empty.
-
AuthorPosts
-
May 7, 2010 at 10:27 am #28947expo703Participant
Upload Form keeps saying INCORRECT FUNCTION. When trying to Upload…
This is what I have so far : http://www.promoteyourteam.com/Articles.asp?ID=143Article HTML:
Code: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;
}
}?>
May 10, 2010 at 1:41 pm #75285expo703ParticipantCan anyone help me with this?????????
May 10, 2010 at 8:44 pm #75326Chris CoyierKeymasterAre 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.comThis is also awesome, but ultimately relies on PHP also.
http://www.uploadify.com/May 11, 2010 at 3:50 am #75157noahgelmanParticipantHow 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?
May 12, 2010 at 11:13 am #75429TcooperMemberAs long as the server that hosts the PHP file supports PHP it should work fine with the changes below:
HTML form
Code: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.
May 12, 2010 at 11:20 am #75432expo703ParticipantThanks 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?
May 12, 2010 at 11:46 am #75435TcooperMemberWell, you could write your form handler in ASP if you don’t have access to a PHP enabled server.
May 12, 2010 at 12:07 pm #75436expo703Participant"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.
-
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.