Image not showing after UPLOAD in EDIT-Mode

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
mn6216
User
Posts: 5

Image not showing after UPLOAD in EDIT-Mode

Post by mn6216 »

After upload finished or in Edit-Mode images do not show due to following Error (Chrome Console Log):

"Resource interpreted as Image but transferred with MIME type text/html: "<domain>/ewupload10.php?id=x_Logo&file=image.png&version=thumbnail&download=1". ..."
It seems that ewupload10.php has MIME-Type problem !??

How can I solve this!
(we have tried in all different browsers, all the same; it also happens on all kind of webservers, we have tried on different linux-configs).

Thanx for hints.

greats
mario


mobhar
User
Posts: 11905

Post by mobhar »

Have you followed the following sections:

  • Tutorial - File Upload to Folder
  • Tutorial - File Upload to Database
  • Field Setup -> Image
  • Field Setup -> Edit Tags -> File

from the help file?


danielc
User
Posts: 1599

Post by danielc »

It seems that your image does not upload successfully or not image type file exist. So, in edit mode, there is no image displayed.

Is there any success message show after you upload your image? Do you see the image in list page after upload? Are you using the latest version, 10.0.1?


mn6216
User
Posts: 5

Post by mn6216 »

The image is uploaded because it shows in the List and in View mode of Detail page.
I've taken the image out in ewp10.js for now, since it does not work in edit/upload mode.

Of course I've upgraded to last version and have a clean install of all extensions.
In am a heavy user of PHPMaker since Vers. 4 for a couple of years and believe to be very esperienced in PHP/JS Development in general.

By the way: PHPMaker 9.2 has been de-installed properly.
I upload normal jpg images. The "uploadhandler.php" puts the images into a temporary file structure which obviously does not load properly with ewlookup10.php (using the right properties).

Something is wrong more deeply. CHMOD of uploadfolder to 777


Webmaster
User
Posts: 9438

Post by Webmaster »

Have you tried with other browsers such as IE or FF? Is the problem with Chrome only or with all browsers?


mn6216
User
Posts: 5

Post by mn6216 »

Yes, it happens in all browsers, IE, Mozilla, Opera +++

Everything worked ok with PHP Maker 9.2 - same options applied in general, table and field settings/edit tags+++

Changed only the "Set locale" settings in PHP>General options (I use german locale settings with decimal point being comma and thousand seperator set to a point.)


Webmaster
User
Posts: 9438

Post by Webmaster »

  1. Check for any javascript error on the page
  2. After uploading the image, but before submitting the form, check if temp images are created under: <upload folder>/temp<session id>/x<field>/<image name> and <upload folder>/temp<session id>/x<field>/thumbnail/<image name>

mn6216
User
Posts: 5

Post by mn6216 »

Look further up at my previous posts, no javascript errors / yes, temp directory is generated, but no image shown.

I wonder, am I the only one who got this problem !?


Webmaster
User
Posts: 9438

Post by Webmaster »

Is there any upload images in the temp folders?


mn6216
User
Posts: 5

Post by mn6216 »

FOUND THE PROBLEM.

Following urls are generated:
http.//www.*.com/admin/ewbv10.php?fn=upload%2Flogo.png&width=0&height=120 works perfectly (view mode)
http.//
*.com/admin/ewupload10.php?id=x_Logo&file=logo.png&version=thumbnail&download=1 does NOT work (edit mode)

<td class="preview"><a><img width="200" src="http.//****.com/admin/ewupload10.php?id=x_Logo&file=logo.png&version=thumbnail&download=1"></a></td>

The preceeding www. is not generated in EDIT-Mode, which leads the browser to a false URL on my server (because we are needing the www. in front of the domain-name.TLD

Where can I change this in program code


Webmaster
User
Posts: 9438

Post by Webmaster »

The host name is returned via:
isset($SERVER['HTTP_HOST']) ? $SERVER['HTTP_HOST'] : ($_SERVER['SERVER_NAME']

Check your configuration why $_SERVER['HTTP_HOST'] did not return the proper host header.


Post Reply