The Upload Form code (below) that moves files from Temp folder to /Upload folder.
It also copies NoInfoAvailable.png if a file is not uploaded, so that when a link is selected it will show a message “no info available”. Is it possible to show a NoInfoAvailble page instead of a NoInfoAvailable image? so that users can select a “back to previous page” button, on that page, for their convenience? if so, how can i change this code to accomplish that?
I would think you could just replace that copy code with a header. Notice I also moved the session thumbnail and file location lines up as they would no be SET.
Thanks again for replying.
However, with that modification, when a file isn’t uploaded, upon Submit, the NoInfoAvailable.php page appears. I probably wasn’t clear in my initial posting.
The PHP script’s Upload Form that I’m using ultimately uploads a video. It has been modified so that the user, after filling in the Form, can optional add an image file to his Form info, then the Submit button uploads the Form info and (optional) image.
After Submit the next page is where the user selects a video file to upload. When the video is searched a link appears next to the video thumbnail image. The link is for viewing the (optional) image file. When a file has not been uploaded via the Form, the link shows the NoInfoAvailable.png successfully. I’m now looking for a modification that when a file has not been uploaded via the Form, the link shows the NoInfoAvailable.php, instead of NoInfoAvailable.png.
Much thanks again for your reply.
When I run the Form and then select the link, after not uploading an image,
I see www…com/upload/NoInfoAvailable.php.
How can it just be: www…com/NoInfoAvailable.php ?
OK, so I’m a bit confused.
Do you want the image copied? Yes I assume.
But you wish the LINK associated with this image to go to NoInfoAvailable.php.
Does that sound right?
If this is the case, do we really need to copy the image? Just use the default image for the link icon.
Yes, no… Please explain.
Thanks again for your reply and assistance. Greatly appreciated.
Sorry for any confusion. Yes, I’d like to instead of copy the NoInfoAvailanle.png,
I’d like the user to see a NoInfoAvailable page.
Sorry to report that after trying your latest code, I still see
I see www…com/upload/NoInfoAvailable.php.
Any help with just seeing: www…com/NoInfoAvailable.php
will be appreciated.
Yes and on my test, if no file is selected the variable $file_location is set to an image/link. When echoed, it shows the image like this (on my copy) which links to www…com/upload/NoInfoAvailable.php.
Thanks again for your reply.
I only see this in the browser: http://www.thedomainname.com/upload/
after I don’t choose a file to upload and then Submit the Form, and then select the page link. It’s the same outcome as when I select the wrong file format to upload (and proceed). Both outcomes show http://www.thedomainname.com/upload/ and “Access Forbbiden” on the page that appears.
Any additional help will be welcomed.
When you view html source code do you see <img src="upload/NoInfoAvailable.png" alt="No Image"> You should be seeing the image tag. Maybe the path to the file is not correct.
The reason I was asking about how you render the variable on the next page is because I wasn’t sure if you were just echoing the variable(s) or building a link with parts. Can you post or explain what you are doing code wise with $file_location?
Thanks again for your reply.
I looked in the html source code from the Upload Form page, the html source code from the Access Forbidden page and the html source code from the (search) Results page and I didn’t see anything with NoInfoAvailable.
Regarding “code wise with $file location”, other than what is posted in #10, I’m not clear on what you’re asking for.
Thanks again for your replies.
Any additional help will be appreciated.
NO not the error page… I assume it would be when viewing inner_upload_video.htm but then again how are you echoing $file location if it’s a htm page. This is what I am not following with your template system. Again how are you echoing $file_location and what does it show when you view the source.
So what is causing this error to show? We are currently not setting $_SESSION['thumbnail']. Is this required?
So the coding where these two values has never been provided. Is the $file_location used for the “link” and $_SESSION[‘thumbnail’] used for “what is put between <a> tags”? IF THAT’S the case, Then my single line, e.g.
Thanks again for your reply.
I’m sorry I’m not a coder, and therefore don’t know how to answer your questions about $file_locations, or how exactly the templated script works, as I’m not the author. I can tell you that I tried your suggestion of “two parts” without success. I can tell you that the “thumbnail” refers to the column name in the db that stores the uploaded files.
I’m not sure if this will shed some light, but when when I received past help with this Form, regarding $Session, I was told: “You should try moving the $_FILES calls to the uploader_finished.php file. Right now you’re INSERTING to the database before the file information has been INSERTED.
I think the best way to do this would be to add a session variable in the uploader.php and then use that session variable in the uploader_finished.php”. And it worked successfully.
Thanks for your message.
Yes I have a NoInfoAvailable.php page.
And have added the full url’s without success (and corrected the spelling of “Available”).
Any other assistance will be welcomed.