I think you're getting the error 500 because your script doesn't produce
Post by Gregory Lypny
Thank you kindly sharing your code. I’m afraid that it is a little too advance for my skills, and my needs are much simpler. I am able to create an upload form and move the uploaded file from the tmp folder on my Mac to another folder using a shell command. There are only two problems left that I need to fix. One is that an internal server error occurs (error 500) and it is output to the web page. The other problem is that the moved file has read and write access for group _WWW but no access for anyone else.
Here is what I did. The HTML in the web page is
<form enctype="multipart/form-data" action="submitAssignmentScript.lc" method="POST">
Choose a file to upload: <input name="uploadedfile" type="file" /><br />
<input type="submit" value="Upload File" />
where the action, “submitAssignmentScript.lc”, simply refers to a handler named submitAssignment in a stack named myServer
start using stack myServer.livecode
The handler contains the following
put the keys of $_Files[uploadedfile] into theKeys
put the long date && long time & return into output
repeat for each line thisLine in theKeys
put thisLine & ":" && $_Files[uploadedfile][thisLine] & return after output
delete the last character of output
put output into url (dataFilePath & "Upload Info.csv")
get shell ("mv" && $_Files[uploadedfile][filename] && "../share/httpd/myData/" & “Uploaded-File.pdf")
where “Upload Info.csv” contains some information from $_Files.
If anyone can help me figure out why I’m getting the the internal server error and how I can change the moved file’s permissions, I’d much appreciate it.
use-livecode mailing list