https://www.icyphoenix.com/viewtopic.php?f=29&t=3903
-----------------------------------
franjavi-35
Thu 20 Mar, 2008 00:46

I Can't Put Capture Images In Downloads
-----------------------------------
Hi friends, I have this problem:

When I add a new download, and I write the URL of the capture image, I click to send the download, but when I go to edit the download I see that there isn't any image!! it is very strange........see it this:

I put the link of the image uploaded to imageshack and I push the botton "Add file":
[img]http://img247.imageshack.us/img247/3618/captura1vu4.png[/img]

Later, I go to see the download and the capture isn't appeared!!!
[img]http://img209.imageshack.us/img209/5532/captura2il7.png[/img]

So, I go to edit the download and I return to put the capture image, I send but the image, doesn't appear......

Please support, I don't know what I have to do!!!


-----------------------------------
xmenfile
Thu 20 Mar, 2008 01:08

Re: I Can't Put Capture Images In Downloads
-----------------------------------
I think you forgot to click on "Yes" right below it.


-----------------------------------
franjavi-35
Thu 20 Mar, 2008 02:25

Re: I Can't Put Capture Images In Downloads
-----------------------------------
[quote user="xmenfile" post="26534"]I think you forgot to click on "Yes" right below it.[/quote]no friend, the problem persists


-----------------------------------
moreteavicar
Thu 20 Mar, 2008 03:40

Re: I Can't Put Capture Images In Downloads
-----------------------------------
How about clicking on "si" below it... ;)

Image shack doesn't allow hot-linking of images - you should download the image and upload to your server instead.


-----------------------------------
franjavi-35
Thu 20 Mar, 2008 10:21

Re: I Can't Put Capture Images In Downloads
-----------------------------------
No my friend, the problem persists :cry:


-----------------------------------
moreteavicar
Thu 20 Mar, 2008 14:30

Re: I Can't Put Capture Images In Downloads
-----------------------------------
I don't know what you tried, so I shall re-phrase my last post:

1) In your original post, you are linking to an imageshack hosted image.
2) Imageshack do not allow you to link to an image on another website - this is called "hot-linking".
3) Upload the image to your own server instead.

If you tried 3 already, then please tell us this - problems can't be solved if we don't know all the conditions.


-----------------------------------
ThE KuKa
Fri 21 Mar, 2008 11:56

Re: I Can't Put Capture Images In Downloads
-----------------------------------
Is a bug, so I have to check on my website. 

Upload the image to the server -> Not display capture 
Upload capture from PC -> Not display capture

	
This happens since the launch of the patch 1.2.0.27a

Report to the BUGs forum.


-----------------------------------
hal9000
Sat 22 Mar, 2008 20:33

Re: I Can't Put Capture Images In Downloads
-----------------------------------
[quote user="ThE KuKa" post="26611"]Is a bug, so I have to check on my website. 

Upload the image to the server -> Not display capture 
Upload capture from PC -> Not display capture

	
This happens since the launch of the patch 1.2.0.27a

Report to the BUGs forum.[/quote]
I was having this problem with the version 1.2.0.27 without the patch too, so it's older than that. Now I'm updating to 1.2.0.27a to check if this fix the bug with the group permissions for sub-forums.


-----------------------------------
moreteavicar
Wed 09 Apr, 2008 11:43

Re: I Can't Put Capture Images In Downloads
-----------------------------------
As a wise man once said - check the permissions of the pafiledb/images/screenshots folder - this should be 777. ;)


-----------------------------------
hal9000
Wed 09 Apr, 2008 14:14

Re: I Can't Put Capture Images In Downloads
-----------------------------------
[quote user="moreteavicar" post="27499"]As a wise man once said - check the permissions of the pafiledb/images/screenshots folder - this should be 777. ;)[/quote]

Sorry, but I don't agree. My "screenshots" folder has 777 permissions and I cannot put any screenshot to my downloads (I cannot put uploaded screenshots nor URL screenshots), or at least to downloads without file and an URL instead, later I will try with downloads with a file.


-----------------------------------
hal9000
Wed 09 Apr, 2008 14:57

Re: I Can't Put Capture Images In Downloads
-----------------------------------
Ok, I confirm that it doesn't work either for downloads with an uploaded file instead of an URL.


-----------------------------------
moreteavicar
Wed 09 Apr, 2008 15:20

Re: I Can't Put Capture Images In Downloads
-----------------------------------
Hile good sir... have you checked via your ftp / cpanel if the image file is actually uploaded into your screenshots directory? And also if the file is uploaded into the uploads directory? Permissions must be set to 777 for pafiledb/uploads folder as well - I'm guessing you already know this, but best to check first ;). (I know the installer should automatically do the chmod, but it might not have done it properly, or you might be on a host where your host disabled php chmod function, so you would have had to apply chmod manually - its easy to overlook something to chmod)...


-----------------------------------
hal9000
Wed 09 Apr, 2008 15:44

Re: I Can't Put Capture Images In Downloads
-----------------------------------
[quote user="moreteavicar" post="27514"]Hile good sir... have you checked via your ftp / cpanel if the image file is actually uploaded into your screenshots directory? And also if the file is uploaded into the uploads directory? Permissions must be set to 777 for pafiledb/uploads folder as well - I'm guessing you already know this, but best to check first ;). (I know the installer should automatically do the chmod, but it might not have done it properly, or you might be on a host where your host disabled php chmod function, so you would have had to apply chmod manually - its easy to overlook something to chmod)...[/quote]

Yes, both "uploads" and "screenshots" folders has 777 permissions.

I CAN:
1) create a download uploading a file
2) create a download linking an external file via its URL

I CANNOT:
1) upload a screenshot for a download (don't matter if uploaded or linked file): the screenshot is not uploaded
2) link a screenshot via its URL (don't matter if uploaded or linked file): the screenshot is not shown nor its URL retained in the textbox when I edit the download

In fact, I've been looking inside "admin_pa_file.php" and I can find a few [b]"$_FILES['new_userfile']"[/b] and [b]"$_FILES['userfile']"[/b] bot not a single [b]"$_FILES['new_screen_shot']"[/b] nor [b]"$_FILES['screen_shot']"[/b].


-----------------------------------
moreteavicar
Wed 09 Apr, 2008 16:39

Re: I Can't Put Capture Images In Downloads
-----------------------------------
[quote user="hal9000" post="27517"]
In fact, I've been looking inside "admin_pa_file.php" and I can find a few [b]"$_FILES['new_userfile']"[/b] and [b]"$_FILES['userfile']"[/b] bot not a single [b]"$_FILES['new_screen_shot']"[/b] nor [b]"$_FILES['screen_shot']"[/b].[/quote]

No you won't find it there... This is handled in functions_pafiledb.php ;)

I'm not sure why you get this problem... Is it a recent occurrence? If you tried a fresh install of IP and tested it, does the problem still happen? 
I can upload screenshot images no problem with IP1.1.27, but not yet tried via URL, I'll check that in a little while.


-----------------------------------
hal9000
Wed 09 Apr, 2008 16:51

Re: I Can't Put Capture Images In Downloads
-----------------------------------
[quote user="moreteavicar" post="27518"]I'm not sure why you get this problem... Is it a recent occurrence? If you tried a fresh install of IP and tested it, does the problem still happen? 
I can upload screenshot images no problem with IP1.1.27, but not yet tried via URL, I'll check that in a little while.[/quote]
I just tried in two fresh IP installations (on two different servers) with the same result. :(


-----------------------------------
moreteavicar
Wed 09 Apr, 2008 18:22

Re: I Can't Put Capture Images In Downloads
-----------------------------------
Can you upload (the same) images to album ok? Just a thought... in case your host has a block on certain media / image files...


-----------------------------------
hal9000
Wed 09 Apr, 2008 18:25

Re: I Can't Put Capture Images In Downloads
-----------------------------------
[quote user="moreteavicar" post="27522"]Can you upload (the same) images to album ok? Just a thought... in case your host has a block on certain media / image files...[/quote]
I don't think so, because the files I'm uploading in these test are graphics files too. Anyway, that would make that I could not upload an screenshot but it still shoulds work if I use an linked screenshot via URL, but the forum simply forgets that field which appears empty when I edit the download.


-----------------------------------
moreteavicar
Wed 09 Apr, 2008 22:44

Re: I Can't Put Capture Images In Downloads
-----------------------------------
Whenever you enter fields into the downloads form and submit them - the fields that you've entered are not echoed back on edit / reload - so you will never see the data / url you've entered... perhaps this could be a design over-site that could easily be remedied to avoid this slightly confusing matter (all mods that I write which take user input echo back what they type on reload, as a matter of principle on usability).

Anyway, again I'm not sure why you have these issues - I've just tried screenshot images via URL and it works for me. It is latest IP, fresh install. One trick which seems to be the case with Xmenfile's download woes, appears to be the htaccess preventing downloads / media files, though they can be uploaded - so maybe you can try removing the root htaccess file and see if that has an effect - though, this is very much the same htaccess file as previous few icy releases. Sorry, apart from that, I really can't think of anything else, unless the URL images you linked to don't allow hot-linking...  :(


-----------------------------------
hal9000
Wed 09 Apr, 2008 23:27

Re: I Can't Put Capture Images In Downloads
-----------------------------------
[quote user="moreteavicar" post="27540"]Whenever you enter fields into the downloads form and submit them - the fields that you've entered are not echoed back on edit / reload - so you will never see the data / url you've entered... perhaps this could be a design over-site that could easily be remedied to avoid this slightly confusing matter (all mods that I write which take user input echo back what they type on reload, as a matter of principle on usability).[/quote]
No, no... I think you misunderstood me. I mean that if I create a download without upload, using an URL for the file, and using an URL for the screenshot too, once I submit the form and then go to edit that download, the textbox of the file URL appears filled with the URL I used when I created the download, while the textbox for the screenshot URL appears empty, instead of recover the "supposedly" saved value.

[quote user="moreteavicar" post="27540"]Anyway, again I'm not sure why you have these issues - I've just tried screenshot images via URL and it works for me. It is latest IP, fresh install. One trick which seems to be the case with Xmenfile's download woes, appears to be the htaccess preventing downloads / media files, though they can be uploaded - so maybe you can try removing the root htaccess file and see if that has an effect - though, this is very much the same htaccess file as previous few icy releases. Sorry, apart from that, I really can't think of anything else, unless the URL images you linked to don't allow hot-linking...  :([/quote]
I must insist... it cannot be related to file types for two reasons:
1) it fails too for linked screenshot, where no image file is uploaded at all
2) if I upload an image file as the file to be downloaded instead of its screenshot, it's perfectly uploaded

As for the hotlinking, the images I've used allow hotlinking. But in addition, anyway if the image doesn't allow hotlinking, I would obtain another image or a box of "image not found" or similar... but its URL would remain stored with the rest of the download data fields... and as I said a few times before... the URL its totally ignored and forgotten.

May be I'm not expressing correctly in English, if you will I can explain it in Spanish, which I think you can speak on, correct me if I'm wrong.


-----------------------------------
Mighty Gorgon
Wed 09 Apr, 2008 23:37

Re: I Can't Put Capture Images In Downloads
-----------------------------------
I need to test this personally to understand.

I will contact you privately.


-----------------------------------
moreteavicar
Thu 10 Apr, 2008 11:31

Re: I Can't Put Capture Images In Downloads
-----------------------------------
Hile Hal, sorry perhaps I was not very clear in my last post. What I was getting at is that I suspect the problem is something server related, not that they are blocking images explicitly - if you see [url=http://www.icyphoenix.com/viewtopic.php?f=2&t=3941]This thread you will see that there were problems trying to download media files as a result of htaccess (though I can't yet understand why, he has the standard icy htaccess file) - yet he could upload.

The point about the input form fields - what I am trying to say is that generally those forms do not display what you submit because there is no line in the template file to echo back the variable of the filename you uploaded. If you look in pa_file_add.tpl (which is used for upload / edit upload), none of the html input fields on the form echo any variables. By this I mean (this is an example from a mod I'll be releasing soon, nothing to do with pafiledb):

[code linenumbers=false] <td width="80"><input name="max_file_size" size="5" value="<?php echo $_POST['max_file_size']; ?>"  /> </td>[/code]

Without some form of echo line, nothing you submit will be repeated by the script. However, for to to see your filename being filled in the box, I believe this was as a result of your browser auto-form filling a regularly filled box (firefox behaves like this - if you fill in the same named box a few times, it will list all the previous entries you type in, if you submit in a box just once or twice, it doesn't always auto-fill that box).

Anyway, looks like the boss is on the case ;)

Greetz!


-----------------------------------
Mighty Gorgon
Wed 16 Apr, 2008 00:50

Re: I Can't Put Capture Images In Downloads
-----------------------------------
I still had no time to make some extra tests...

Sorry but I have urgent things to take care... I will try again hopefully in the weekend.


-----------------------------------
hal9000
Wed 16 Apr, 2008 01:49

Re: I Can't Put Capture Images In Downloads
-----------------------------------
[quote user="Mighty Gorgon" post="27745"]I still had no time to make some extra tests...

Sorry but I have urgent things to take care... I will try again hopefully in the weekend.[/quote]
Don't worry, Luca.  It's not something urgent anyway. ;)


-----------------------------------
moreteavicar
Thu 17 Apr, 2008 02:55

Re: I Can't Put Capture Images In Downloads
-----------------------------------
[b]Hal[/b] I must insist... it must be server related  :P 

I know its not urgent, but perhaps for a "sanity check" - have you tried comparing a fresh install of old icy, e.g. 1.0.15 against a fresh install of 1.0.27 ?

I recently tried various versions, old and latest, of IP on 3 servers, all of which work correctly. With fresh installs, server configurations are the only variables.

Also another tact: can you create your own page in cms? I mean here, using the cms to create an actual page in your root directory, e.g. "hals_page.php". If you can't do this, it would suggest a problem with using php fwrite function - some hosts limit the scope this function works in (though you would expect to see an error message). Why it should allow creation of the uploaded file, but not the image, I don't know... 

Perhaps here is another point, [b]which is why it was worth checking uploading the images in album[/b]. (It is always worth checking these things even if you think you can use logic to say it should already work - theres nothing to lose in trying, and it might reveal something else unexpected - remember, nobody here can actually play with your server to see whats up). The fault could also be to do with your gd image library - since gd image library is used to handle the screenshot images. So... if you have problems uploading the images to album, it could well be related to gd image configuration, and not explicitly the host blocking images. (An immediate check would be to see how captcha image is generated - but also still try uploading image to album). Or even, how big are the images - perhaps they exceed memory limit?

Anyway, that's my lot - I say all this so that maybe MG will not waste so much time looking for something in the scripts, which so far seem to work properly.


-----------------------------------
hal9000
Thu 17 Apr, 2008 10:38

Re: I Can't Put Capture Images In Downloads
-----------------------------------
Thanks for your interest, moreteavicar. I like to know why things doesn't work too, even they are not urgent. But I insist that i's not a problem on write permissions nor anything related to writing: I can upload files, and these files can be images.

And if it was a problem on writing, at least it would work for thumbnails not uploaded, but linked instead, but it doesn't work for that either.  As I said a few times before: [b][u]the information for screenshot (whether file or URL) is simply ignored and forgotten.[/u][/b]

I tried it on two different servers with the same result, and although I didn't checked with an old IP, I did it with  phpBB XS 2 (build 058) in the same server and with XS it works perfectly.


-----------------------------------
moreteavicar
Thu 17 Apr, 2008 20:02

Re: I Can't Put Capture Images In Downloads
-----------------------------------
And what about gd support? Thats why I also say to try uploading the same images in album.php.

The information for the screen shot file is "forgotten" - in fact its not stored - because, I suspect, it can't be processed or saved - info only goes into DB if it can be saved / stored. (Here I now assume you mean forgotten in DB, rather than expecting to see the data in the input fields in the edit uploads page - read my post before Luca's about that point).

Anyway, like I say... indeed, I insist, it is best to try these various things out yourself - there is simply too much going on in the scripts to use basic arguments about file writes e.g. "if they work in one place, they should work all over" - file writes depend for example on whether or not apache deems the file being written is within the allowed scope of the current script, and the decision logic could for example depend on the directory being written to... and who knows what else from all manner of murky things that a host might have done - since they try and limit the scope of fwrite as much as possible to avoid security problems. You can only find these things out by trying them all, not by using reason. (And php itself does not always act in a logical / reasonable manner! Things like open_basedir restriction can effect file and directory operations in a way not documented at php.net, and various other unexpected behaviour I won't go into here). I speak from experience. ;)

Adiós


-----------------------------------
hal9000
Thu 17 Apr, 2008 20:28

Re: I Can't Put Capture Images In Downloads
-----------------------------------
Well, since in the same server XS accept the screenshots perfectly while IP doesn't, I think there's for sure that is not a server related problem, as I said.

I'll wait for Luca to have the time to look at it, or if I need the feature and I have the time I'll try to fix it by myself, looking at the code, where the problem is, and not in the server.

Thanks anyway for your interest. :)


-----------------------------------
moreteavicar
Fri 25 Apr, 2008 20:53

Re: I Can't Put Capture Images In Downloads
-----------------------------------
You don't understand my point, but oh well. Maybe I am talking to a computer... a Z80! ;) [b]The point is about gd.[/b] You might very well be able to upload images without using IP. fine. Buts transferring images directly to the server is [b]not[/b] the issue I'm suggesting in previous post. The problem could be with the nature of how the upload scripts in IP operates, since they use gd libraries to generate screenshot thumbnails. If it can't make the thumbnails, then it doesn't store the screenshot.... Why is it so much work for you to try uploading an image in album.php to see if problem occurs there also, rather than wait for mg to waste his time and try and fix a problem that potentially doesn't exist? Unless you try that, how will anybody know for sure if there is a problem? I thought, having some php knowledge, you would understand this. :?


-----------------------------------
Lopalong
Sat 26 Apr, 2008 01:21

Re: I Can't Put Capture Images In Downloads
-----------------------------------
[quote user="hal9000" post="27818"]Well, since in the same server XS accept the screenshots perfectly while IP doesn't, I think there's for sure that is not a server related problem, as I said. :)[/quote]

The last time I saw images / files disappearing like this, where one forum worked and the other didn't was because there was a 'local' php.ini file in the root of one of the forum software that had the MAX filesize set higher than the server would allow overall.

The other was suexec running through the apache server, and doesn't allow folders to be Chmod to 777 as it poses a risk, and is generally indicated in the Server Error Log, But I haven't seen the Log mentioned here for any possible reasons as to why this is not working, or any other log entries that could suggest as to why it may be blocked from functioning?


-----------------------------------
hal9000
Sat 26 Apr, 2008 20:23

Re: I Can't Put Capture Images In Downloads
-----------------------------------
Oh my God... My English must be worse than I thought...

Moreteavicar: [b]It's not related to uploading since it affects as well to the linked screen shots, which are not uploaded anywhere but only used as the "src" in the img tag.[/b] Can it be understood this time? Any way, for your info, image uploads works perfectly on album. As I said from the very first time, [b]it's not related to uploading[/b].

Anyway, thanks for your interest on my server's image uploading capabilities.


-----------------------------------
Mighty Gorgon
Sat 26 Apr, 2008 22:58

Re: I Can't Put Capture Images In Downloads
-----------------------------------
I still didn't have the time to make full tests on this.

Please be patient a little bit... I will do sooner or later. :lol:


-----------------------------------
hal9000
Sun 27 Apr, 2008 01:51

Re: I Can't Put Capture Images In Downloads
-----------------------------------
[quote user="Mighty Gorgon" post="28056"]I still didn't have the time to make full tests on this.

Please be patient a little bit... I will do sooner or later. :lol:[/quote]
Don't worry, Luca. It's not urgent as I said before. Even may be that I can find the time before you do, so I can try and fix it by my self. If so I'll let you know. ;)


-----------------------------------
hal9000
Tue 29 Apr, 2008 18:57

Re: I Can't Put Capture Images In Downloads
-----------------------------------
Update about the problem.

1) I [b]edit manually the database[/b] and put the URL of an image in the field [b]"file_ssurl"[/b] of a download
2) I can go then to the page of that download and [b]I can see perfectly the screenshot[/b]
3) I press the edit button for that download and in the edition form [b]I can see the box for the screenshot URL filled[/b] with the value which I entered before manually in the database
4) I press the [b]"submit"[/b] button withou make any change
5) I go again to the page of that download and... What a surprise! [b]The screenshot has gone![/b]

I'll continue looking for the bug in the code.


-----------------------------------
Mighty Gorgon
Wed 30 Apr, 2008 16:25

Re: I Can't Put Capture Images In Downloads
-----------------------------------
Please try this:

OPEN [b]pafiledb/includes/functions_pafiledb.php[/b]
FIND
[codeblock]		if(!empty($ss_remote_url) || !empty($ss_local))
		{
			if($ss_upload)
			{
				$ss_extension = $pafiledb_functions->get_extension($ss_name);

				if(in_array($ss_extension, $forbidden_extensions))
				{
					// block unwanted screenshots
					//echo($phpbb_root_path . $pafiledb_config['screenshots_dir'] . $ss_name . ' - FORBIDDEN');
					$screen_shot_url = '';
				}
				else
				{
					$screen_shot_info = $pafiledb_functions->upload_file($ss_local, $ss_name, $ss_size, $pafiledb_config['screenshots_dir']);

					if($screen_shot_info['error'])
					{
						message_die(GENERAL_ERROR, $screen_shot_info['message']);
					}
					$screen_shot_url = $screen_shot_info['url'];
				}
			}
			else
			{
				$screen_shot_url = $ss_remote_url;
			}

			if ( ($screen_shot_url != '') && (!$temp = @getimagesize($screen_shot_url)) )
			{
				// remove unwanted screenshots
				@unlink($phpbb_root_path . $pafiledb_config['screenshots_dir'] . $ss_name);
				$screen_shot_url = '';
			}
		}[/codeblock]
REPLACE WITH
[codeblock]		if(!empty($ss_remote_url) || !empty($ss_local))
		{
			if($ss_local)
			{
				$ss_extension = $pafiledb_functions->get_extension($ss_name);
				if(in_array($ss_extension, $forbidden_extensions))
				{
					// block unwanted screenshots
					//echo($phpbb_root_path . $pafiledb_config['screenshots_dir'] . $ss_name . ' - FORBIDDEN');
					$screen_shot_url = '';
				}
				else
				{
					$screen_shot_info = $pafiledb_functions->upload_file($ss_local, $ss_name, $ss_size, $pafiledb_config['screenshots_dir']);
					if($screen_shot_info['error'])
					{
						message_die(GENERAL_ERROR, $screen_shot_info['message']);
					}
					$screen_shot_url = $screen_shot_info['url'];
				}
			}
			else
			{
				$screen_shot_url = $ss_remote_url;
			}

			if ($screen_shot_url != '')
			{
				$server_path = create_server_url();
				if (strpos($screen_shot_url, $server_path) !== false)
				{
					$ss_localpath = str_replace($server_path, '', $screen_shot_url);
					$is_image = @getimagesize($ss_localpath);
					if($is_image === false)
					{
						// remove unwanted screenshots
						@unlink($phpbb_root_path . $pafiledb_config['screenshots_dir'] . $ss_name);
						$screen_shot_url = '';
					}
				}
			}
		}[/codeblock]


Let me know.


-----------------------------------
hal9000
Wed 30 Apr, 2008 17:37

Re: I Can't Put Capture Images In Downloads
-----------------------------------
Yes!! It works!!!  :D  :D  :D 

Thanks, Luca. Now I don't have to spend the time looking for the bug... although I'll have to spend the time adding images to the downloads...  :mrgreen:


-----------------------------------
Shroom
Mon 04 Aug, 2008 16:33

Re: I Can't Put Capture Images In Downloads
-----------------------------------
oo I proppa needed this fix.. Thanks =]

 :mricy:


-----------------------------------
novice programmer
Mon 04 Aug, 2008 17:24

Re: I Can't Put Capture Images In Downloads
-----------------------------------
If it works I will set it the fixed tag and move it to bugs...


