dlen Posted June 13, 2016 Share Posted June 13, 2016 Hi there, I got a template with a field of type "file" in it. If the client did load a file up, a download link is shown - otherwise nothing. The templates name is "termin" and the fields name is "termininfo". middlecontent is some string that collects the HTML. My method to find out, whether a file has been uploaded, is the following: if ($termin->termininfo) $middlecontent .= "<a href='{$termin->termininfo->url}' target='_blank'>INFO</a>\n"; else $middlecontent .= "<a class='hidden'></a>"; My question is, why in some cases, which i cannot really reproduce, the condition $termin->termininfo is false, although a file has been uploaded. This occurs only in a fresh dataset, where no file has been uploaded previously. Maybe there is a better way to check for the existence of the uploaded file. cheers... Link to comment Share on other sites More sharing options...
Ivan Gretsky Posted June 13, 2016 Share Posted June 13, 2016 Maybe you need to configure what the file field object returns when there is no data attached? It is done on the details tab. Any configuration should not cause the behaviour you're describing, but still... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now