Help - Photos are not uploading

Hello,

I am hoping you can help me with this,

Photos are not uploading in the Sell section on my site,

Is it a Host problem or a website problem?

Is there some way to finding out?

your help appreciated

:slight_smile:

@RayWilk

You need to give us more to be able to help you.

[LIST=1]
[]Is the ‘Self’ section of your site something you programmed; or have you used a class or some other type of plugin for this functionality?
[
]Can you post the code from the point where the application gets the $_POST data down to the upload section of the code?
[*]Can you post a link to this site so we can get an idea of how it is working.
[/LIST]With a little more info we would be happy to help.

Steve

Hello dklynn & emoviefreak, thank you for your replies

yes “Insufficient information”

my site is: http://trade.comeze.com/index.php

yet to see my photo not-uploading, you will need to Register to get to the Sell page,

your help greatly appreciated

:slight_smile:

A late reply, as I have a huge amount of trouble Logging In and Posting, it shows I am Logged In yet I get:

"The following errors occurred with your submission

You do not have permission to perform this action. Please refresh the page and login before trying again."

and this can happen 10-20 times before my posting is accepted/uploaded.

Then it tells me: “Thank you for posting! Your post will not be visible until a moderator has approved it for posting.”

and the posting vanishes, does not appear on the Thread.

I have emailed the Contact Us twice yet no reply or change :slight_smile:

I am using Firefox, yet same sitepoint behavior on Chrome, Opera and more.

Are there errors shown? Do you get anything if you set:

error_reporting(E_ALL):

If you are trying to move the uploaded file to another directory, does PHP have write access to that directory? Still more information needed.

Hello devbanana

appreciated your reply :slight_smile:

I would like to answer your questions, yet new to this, so a learning curve,

ok what happens on the Photo upload page is the Uploading png image just spins around showing uploading, yet nothing happens.

if I use Inspect Web Element with FireBug, I see this below,

1st Bold being the uploading image,

2nd Bold I am unsure what it is? as I do not use this Hosting site

<td colspan=“2”>
<div id=“display_media_boxes_ad_image”>
<div>
<img src=“images/loading-media.gif”>
</div>
</div>
</td>
</tr>
<tr class=“reguser”>
<tr class=“c4”>
<tr class=“c5”>
<tr class=“c1”>
<tr class=“c2”>
<input id=“item_file_embed_2” type=“hidden” value=“” name=“item_file_embed_2”>
<tr class=“reguser”>
<tr>
<tr class=“reguser”>
<tr class=“c4”>
<tr class=“c5”>
<tr class=“c1”>
<tr class=“reguser”>
<tr class=“c1”>
<tr class=“reguser”>
<tr class=“c1”>
<tr class=“reguser”>
<tr class=“c4”>
<tr class=“c5”>
<tr class=“c1”>
<tr class=“c2”>
<tr class=“c1”>
<tr class=“c5”>
<tr>
</tbody>
</table>
<br>
</form>
</td>
</tr>
</tbody>
</table>
<table width=“100%” cellspacing=“2” cellpadding=“1” border=“0”>
<table align=“center” cellspacing=“0” cellpadding=“0” border=“0”>
<script src=“http://analytics.hosting24.com/count.php” type=“text/javascript”>
<style>
<script src=“http://analytics.hosting24.com/j.js” type=“text/javascript”>
<script type=“text/javascript”>
<noscript><a href=“http://www.hosting24.com/”><img src=“http://analytics.hosting24.com/count.php” alt=“web hosting” /></a></noscript>
<div style=“position: absolute; visibility: hidden;”>
<div id=“facebox” style=“top: 107.5px; left: 306px; display: none;”>
</body>
</html>

this next piece of script is from the sell_items_settings_tpl.php

    &lt;? echo ($setts['max_images'] &gt; 0) ? $image_upload_manager : ''; ?&gt;
&lt;? echo ($setts['max_media'] &gt; 0) ? $video_upload_manager : ''; ?&gt;
&lt;? echo ($setts['dd_enabled'] && $setts['max_dd'] &gt; 0) ? $dd_upload_manager : ''; ?&gt;
&lt;? } ?&gt;

I do not know if any of that helps, if not please guide to what will help :slight_smile:

Hi RayW

Typically the way this works is:

[LIST]
[]html based upload form
[
]CSS to style the form
[]javascript to name the file and to help with the seemingly asynchronous post to a hidden iFrame
[
]php upload script as the target in the iframe.
[/LIST]I gather that you cannot upload a file unless you are logged-in so I was not able to see how or what javascript you were using although on the index page id did see you have a async_upload_media() script.

But again the processes listed above are the most common so make sure you pass the correct form to your async_upload_media() script. Also check that when you post the form you’re posting to the upload_file.php (i guess that is the file you are using?). I don’t know what method you are using to bypass browser refreshes but if it is a hidden iFrame then also check that your hidden iFrame is loading on the same page where you your upload form is located.

Regards,
Steve

RayW

I took a look into http://trade.comeze.com/wanted_manage.php and put set watches in Firebug and stepped through the code. The loading image is called on the onclick, but upload_media_async() javascript method is not being called on the onclick event. For this reason the upload_media_async() method is never called and so subsequently it does not post back to the wanted_mange.php file.

You need to troubleshoot why the onclick event is not working. To do this, use Firefox and install the Firebug addon. Then enable the Script tag. Choose the ‘wanted_manage.php’ file (to see the javascript in this file run in realtime. Beside the line numbers you can toggle a break to trigger when running the script and then use the controls to step into, step over, step out and continue. I would put a break on the onclick and upload_media_async events/methods to determine what is happening during this exchange.

I hope this helps put you on the right troubleshooting path.

Regards,
Steve

Hello ServerStorm, thank you for looking at the Wanted page, and for your detailed reply, I must admit to being a little lost, but with help I will get there…lol

ok I went to the Wanted Ads page, selected a file in “Browse” to upload, Clicked upload, then left clicked on “Browse” to show using Inspect Element with Firebug.

this is what I see:

<tr class=“c1”>
<input id=“nb_uploads_1” type=“hidden” value=“0” name=“nb_uploads_1”>
<td align=“right” nowrap=“”>Upload File</td>
<td>
<div id=“div_file_1”>
<input id=“item_file_upload_1” type=“file” onchange=“upload_media_async(ad_create_form, 1, this.form.item_file_upload_1, document.getElementById(‘item_file_url_1’).value, document.getElementById(‘item_file_embed_1’).value, document.getElementById(‘nb_uploads_1’).value, 4, ‘W_39’);” style=“width: 250px;” name=“item_file_upload_1”>
</div>
</td>
<td></td>

I can not see any mention of the selected file: C:\Documents and Settings\XP Vienna\Desktop\Ray scans\1a.jpg

so I reloaded the Wanted Ads page and this time pasted the URL into the upload area, (C:\Documents and Settings\XP Vienna\Desktop\Ray scans\1a.jpg)

Clicked upload, went to Firebug, the same as above.

should I be seeing the C:\Documents and Settings\XP Vienna\Desktop\Ray scans\1a.jpg in the Firebug script?

all help appreciated :slight_smile:

Some extra information: From Paul Wilkins: http://www.sitepoint.com/forums/showthread.php?831230-Help-with-this-code-problem-please/page2

With an image upload, the transfer seems to be successful.

Here is the data that I see from Google Chrome

Code:

DNS Lookup - 1ms
Connecting - 26ms
Sending - 168ms
Waiting - 1.18s
Receiving - 2ms

So the image was transferred to the server, and the server responsed without issue.

That’s about all the help I can give you from the client side of things.

yet if I go to my hosting server in the uplimg folder ( I presume that were uploaded images should be) nothing there/empty.

:slight_smile:

Hello Server Storm, as far as I an see, by looking and searching I do not have a upload_media_async file anywhere, is is a js or a php ?

but on this page: http://www.daniweb.com/web-development/javascript-dhtml-ajax/threads/408516

both upload_media_async & upload manager for my phpProbid script are shown, can I copy them and save them into my site files ?

are they js or php ?

Ray :slight_smile:

Hi Ray,

Your webpage is getting quite complex; therefore it is hard for me to quide you on how to extract and integrate the www.horror-mail.com.

Rather than me writing out a step by step tutorial, I searched an found one that would be suitable for the type of javascript you are using in your application - mainly that you are not using jQuery our YUI as there are some good tutorials using those libraries as well.

What I recommend is that you first remove the upload, delete all the javascript that is paired with the upload_media_async(); I think that there was a delete_media_async() and maybe even a edit_media_async(), these are the scripts that you should delete (unless you are using them for other purposes?

Then I would implement the script and files that you download at this tuturial: [URL=“http://www.ajaxf1.com/tutorial/ajax-file-upload-tutorial.html”]http://www.ajaxf1.com/tutorial/ajax-file-upload-tutorial.html

I liked this tutorial because it was fairly concise and would fit what you are doing, only the script itself is not a complicated. Due to the fact that your pages are getting complex, reducing some of the complexity is a good thing.

Let me know how it goes.

Regards,
Steve

Hi Ray,

The upload_media_async() is a JS function inside all of your pages but the one instance that I am referring to is in http://trade.comeze.com/wanted_manage.php . This JS is not a file it is script that you have copied and pasted into the wanted_manage.php (and like I said, other pages like your index.php have it pasted into their pages as well); so you will not find separate files the JS is inline.

In your wanted_manage.php file use search to find all calls to upload_media_async() or even just use the search keyword of ‘upload’ to find this function. It is a good idea to search the entire document to understand where this JS function is being called within the wanted_manage.php file as I would not want you to remove it if other places of your page use these JS functions (upload, delete and edit).

I would recommend that you do link your JS scripts - like http://www.daniweb.com/web-developme…threads/408516 does - rather than putting them inline; visually your page becomes easier to understand. I did not check if you are linking any other JS files but I suspect you are not.

One reason I want you to delete the upload_media_async() is the possibility of conflicts with other JS scripts.

Steve