Welcome Guest, Not a member yet? Register   Sign In
File Upload
#1

[eluser]Unknown[/eluser]
Hello, Im currently doing a project that uses the file image class. I currently display a form with inputs and a file input. Now the user should not have to upload a given file when they edit this form all the time. Im wondering how to check to see if the user has submited a file and then check if file upload is sucessful and then process it?

ps - not a native english speaker
#2

[eluser]eoinmcg[/eluser]
If your form input for the file was:
Code:
<input type="file" name="file"  />


Then you could do this
Code:
if($_FILES['file']['size'])
        {
            // do upload here
        }
#3

[eluser]Unknown[/eluser]
[quote author="eoinmcg" date="1265745688"]If your form input for the file was:
Code:
<input type="file" name="file"  />


Then you could do this
Code:
if($_FILES['file']['size'])
        {
            // do upload here
        }
[/quote]

In the do upload here can i use the code ignighter file upload class?
#4

[eluser]eoinmcg[/eluser]
yeah, you'll need to load it there, if you haven't done so already.




Theme © iAndrew 2016 - Forum software by © MyBB