I have an html form to upload a file to be used and an external php script, as shown below, the problem is that when I try to pull the file into the script, it doesn't come up.
is there no way to work purely with the temporary file? I don't want to save the file that is uploaded, I just want to use it for the script and delete it.
I'm not sure because I've never tried it. I have always moved the temp file to a folder on the website and then did whatever with it.
I would have thought, as a last resort if you can't use the temp file, you could move the temp file to an area on your website, do what you need to with it and then use unlink() to delete it from your web site.
I have altered my code to what is below. Now, however, my code produces the following output. Also, after I click submit, the page brings up an open file box that I cannot explain. Finally, no file is created on the server in /tmp. Could there be something wrong in the php.ini file?
the entire code for my script and html page is below. This is, as you can imagine, simply a dummy for a bigger script, but I am trying to get the upload to work before moving on.
Comment out the mime-type check for now or change the mime type to the correct value for the file types you will be uploading.
also, the strange extra open file box still comes up.
What open file box??? I didn't see that mentioned in your previous posts.
The template should work if your server is configured to allow file uploads. Unfortunately system admin is not my strong suit so I can't help much there if it isn't.
If you haven't got a debugger, maybe insert echo statements at various points in your script to check the variable values and to make sure your script gets to the appropriate points in the script for it to run corectly.
I have altered my code to what is below. Now, however, my code produces the following output. Also, after I click submit, the page brings up an open file box that I cannot explain. Finally, no file is created on the server in /tmp. Could there be something wrong in the php.ini file?
...
I can't figure out why this is happening, but after I click the submit button, after i have already uploaded the file (or attempted to), the script runs, displays the error messages or whatever, and then opens a new open file box.
Bookmarks