Jump to content



Latest News: (loading..)

- - - - -

Cannot Upload Files when editing products


  • Please log in to reply
3 replies to this topic

#1   nsquared

nsquared
  • Members
  • 5 posts
  • Real Name:Tara

Posted 27 July 2012 - 10:33 PM

This is a weird one.  I can upload images for a product and they appear in the store, but this I added the ability to upload images for a report.  When you go to update the product it shows that it is uploading but at the preview you get the message "[img]https://lakehavasumotorcyclesales.com/admin/images/icons/warning.gif[/img] No new file uploaded."  
Like I said, the product images will upload, but the report file will not.  This code works perfectly fine on a different server where the store use to be.  I have moved it to a new host.  Here is the code for the image upload:
   if (isset($HTTP_POST_VARS['products_image']) && tep_not_null($HTTP_POST_VARS['products_image']) && ($HTTP_POST_VARS['products_image'] != 'none')) {
$sql_data_array['products_image'] = tep_db_prepare_input($HTTP_POST_VARS['products_image']);
}

And here is the code for the report upload:


// BOF: Inspection Report Upload
  if (isset($HTTP_POST_VARS['products_inspupload']) && tep_not_null($HTTP_POST_VARS['products_inspupload']) && ($HTTP_POST_VARS['products_inspupload'] != 'none')) {
   $sql_data_array['products_inspupload'] = tep_db_prepare_input($HTTP_POST_VARS['products_inspupload']);
  }

//add delete inspection report function
  if ($HTTP_POST_VARS['delete_insp_1'] == 'yes') {
unlink(DIR_FS_CATALOG_IMAGES . $HTTP_POST_VARS['products_inspupload']);
$sql_data_array['products_inspupload'] = tep_db_prepare_input($HTTP_POST_VARS['none']);
}
//end delete incpection report function

// EOF: Inspection Report Upload

Confirmed all fiels exist in database.  Any suggestions would be much appreciated, I am desperate at this point!

#2   nsquared

nsquared
  • Members
  • 5 posts
  • Real Name:Tara

Posted 30 July 2012 - 03:21 AM

Any help would be appreciated, even if I can hire a consultation, I just can't see where it is broken.  Also, after I hit preview, it give the Uploading display and counts up to 100%, but at the preview screen there is the No New Files Uploaded message.

#3   kymation

kymation

    Believers

  • Community Sponsor
  • 6,697 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 30 July 2012 - 03:37 AM

You're apparently using an old version of osCommerce as that code does not match the current version. All I can remember about that old code is:

1. Make sure that the form that posts the image includes 'enctype="multipart/form-data"'

2. The directory the images are being saved to needs the same permissions as the regular images directory (If you're using a different directory.)

Regards
Jim
My Addons

Banners Box 2.3.x  Support
Categories Accordion Box 2.3.x  Support
Categories Images Box 2.2x  2.3.x  Support
Closest Shipper 2.2x  Support
Document Manager 2.2x  Support
Generic Box 2.3.x  Support
Get 1 Free 2.2x  Support
jQuery Banner Rotator 2.2x  2.3.x  Support
Modular Front Page 2.3.x  Support
Modular SEO Header Tags 2.3.x  Support
MVS 2.2x  Support
PDF Datasheet 2.3.x  Support
Price Updater 2.2x
Products Specifications 2.2x  2.3.x  Development Version  Support  Bugs/Suggestions
Request a Review 2.2x - 2.3.x  Support
Similar Products Box 2.2x
Specials Image Overlay 2.3x Support
Theme Switcher 2.3.x  Support

#4   nsquared

nsquared
  • Members
  • 5 posts
  • Real Name:Tara

Posted 30 July 2012 - 03:10 PM

Thank you very much for your response.  The reports are saving to the same directory as the images, so the permissions are correct.  I did verify that 'enctype="multipart/form-data"' is used on all the forms.  Since this works fine on a different server that I think is running PHP4, and this server is on PHP 5, could that be it?