First of all, way cool script/app/etc. This is exactly what I need.
I can get the simple demo to work and upload files, no problem. What I want is something similar to MOO that displays a thumbnail of the file that was just uploaded. Enter the Application Demo.
I've downloaded the sample files and uploaded them to my server exactly as they are. My Application Demo does everything perfectly except display the thumbnail. It doesn't work in IE7.0.5730.11IC, FF2.0.0.14, or Safari 3.1.
I have tried the demonstration url that this site offers on IE7.0.5730.11IC, FF2.0.0.14, and Safari 3.1, and the thumbnails display fine. I'm testing out my site on a PC running on Windows XP.
I am running a LAMP environment for my server. Check out my phpinfo. I'm running php 4.4.7, and I have gd 2.0 enabled. Perhaps someone can see something in my settings that isn't letting the php display the image. I believe that is the cause because I've messed around with the javascript handlers in previous installs of this on my site, and those changes were working fine.
Do I need to create an upload folder before the php can create in image to send to the javascript handler addImage function? Do I need to add an .htaccess file in the folder to allow something?
Someone please help! I'm begging.
Returning 404
The thumbnail.php is returning a 404 status. This means that you are hitting the bit of code where it checks to see if the thumbnail data (based on the id parameter) is stored in the session.
Here are some possibilities:
1. Output buffering is used to grab the thumbnail data and store it in session (it's dumb but it's the only way I could figure out how to get it without saving a file and re-reading it. You could have a configuration issue related to output buffering.
2. Something is messed up with the session. Either you are having a problem with the manual session overriding used in upload.php or there is some other problem with the session. The thumbnail data is stored in session (which is probably a bad thing, but works OK for the demo).
I'll try the write then read method...
Thanks a bunch for answering super fast.
I don't really know where to begin to fix the output buffering configuration, so I think I'll try to save the file, then re-read it. Even though it won't be as good, if it works it will be better than where I am now.
Side note, my .htaccess file is:
Options -Indexes
ErrorDocument 400 https://smarteld.dot5hosting.com/assetgroups/not_found.php
ErrorDocument 401 https://smarteld.dot5hosting.com/assetgroups/not_found.php
ErrorDocument 403 https://smarteld.dot5hosting.com/assetgroups/not_found.php
ErrorDocument 404 https://smarteld.dot5hosting.com/assetgroups/not_found.php
ErrorDocument 500 https://smarteld.dot5hosting.com/assetgroups/not_found.php
RewriteEngine On
# must be the directory the website is in if you share it with other directories
RewriteBase /assetgroups/
# remove .php; use THE_REQUEST to prevent infinite loops
RewriteCond %{THE_REQUEST} ^GET\ (.*)\.php\ HTTP
RewriteRule (.*)\.php$ $1 [R=301]
# remove index
RewriteRule (.*)/index$ $1/ [R=301]
# remove slash if not directory
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} /$
RewriteRule (.*)/ $1 [R=301]
# add .php to access file, but don't redirect
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteCond %{REQUEST_URI} !/$
RewriteRule (.*) $1\.php [L]
#Rewrite non-https to HTTPS without mod_ssl!
#NOTE:The HTTPS variable is always present,evenif mod_ssl isn’t loaded!
#Based on HTTPS variable (best)
RewriteCond %{HTTPS} !=on
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
Perhaps there is something wrong in there. I commented out the whole .htaccess, but that didn't make a difference.
Work Around
I finally got it working by letting the file upload using the upload.php script that is provided in this forum. Then, I use javascript to create an iframe that is 100 x 100 px, then use an adaptation of the upload.php script found in the Application Demo that takes an image and resizes it nicely. I use the
header("Content-Type: image/jpeg");to send the image to my iframe. Basically, instead of using the $_FILE to get the image, I had to use a cookie to save the file name and call it later from my script that uses the php gd library to get the image from where I just uploaded it and resize the image. I've learned a lot by doing all this. It has been great.You can now see my working demo here. Only jpegs work for now. I'll have to do some more tweaking to get others to work of course.
If anyone wants to see my code or has any questions, let me know.
P.S. I still don't know why the other way didn't work. My phpinfo says the output_buffer has "no value". Maybe that's why? Who knows.
Thumbnail is not displaying while uploading.
hi,
I to have the same problem, a thumbnail is not displayed while uploading the images , but the images get saved in the folder.
So what can i do so that the thumbnail can be displayed??
Similar issue
I'm having what sounds like this same issue, but only in Chrome. IE works fine. I can't think of anything to change based on this information. What part of the code would cause this to fail only on a particular browser?