Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[CONTRIBUTION] File uploads as an Option Feature


Guest

Recommended Posts

  • Replies 482
  • Created
  • Last Reply

Top Posters In This Topic

I have been getting the same Error: Destination does not exist error. I followed all the previous posts to make sure the spelling was correct, etc. I chmod'd the directory to 777, but still to no avail.

 

The even weirder thing is that as part of debugging I changed the directory to use the same one I use from the Admin screen when upload product images and I still get the Destination does not exist error.

 

Any clues?

 

Thanks!

Dionn

Link to comment
Share on other sites

How easy would it be to alter this code for another area?

 

We have a requirement for customers to upload .doc files

 

This would be in an area not conected to products.

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

This would be in an area not conected to products.

If it is not connected to products, I would skip this module and start from the admin/includes/classes/upload.php. You can see two ways to use it in admin/categories.php.

 

Hth,

Matt

Link to comment
Share on other sites

Thanks for the insite Matt, I will go to work on that.

 

The idea is to have the upload area in the website, so I take it that this mod would need to then be integrated across from the admin side

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Link to comment
Share on other sites

Essentially, this contribution melds the upload class from admin with Chandra's Option Type Feature contribution. What I did is I copied the upload class from admin to catalog and modified it. You may not have to modify it at all. Just add a tep_draw_file_field where you want it, change tep_draw_form to use the 'enctype="multipart/form-data"' parameter, and do a

$doc_file = new upload(DIR_FS_DOC_FILES);

to catch the result. If you need to rename the files on upload, it would get a little more complicated.

 

The code from this contribution that would be relevant to you would be in product_info.php and includes/application_top.php. Note: as I said above, the modifications that I made to the upload class were to accomodate the way attributes are passed. If you look at this code, you will need to ignore them, as they won't help you.

 

Hth,

Matt

Link to comment
Share on other sites

I have gone through the steps and set up a file upload to my store. I browse - upload and during checkout - i see that it has called it something like /tmp/php32i3to but honestly - i dont know where to find that - or even if i have that file???

 

Can you tell me how and where to find it?

 

thanks in advance.

Link to comment
Share on other sites

/tmp/php{whatever} is an error. Is your store publicly available that I could try a test order? Are you using the latest version of the contribution (.77, topmost links on the contribution page).

 

Thanks,

Matt

Link to comment
Share on other sites

  • 3 weeks later...

Thank you for this contribution :D

 

I would like to combine this contribution: Attributes option type selection

 

includes quantity discounts, minimum number of products order, and conditional option (option1 linked with option2, if you select option1, option2 is automatically selected)

 

 

 

With your File Upload .7 (for PA - Option Type Feature)

 

Do you think it is possible?

Link to comment
Share on other sites

  • 2 weeks later...

I am trying to set up this File Uploads contribution to coexist with the Options as Images (OAI) mod (http://www.oscommerce.com/community/contributions,1467).

 

However, because OAI takes over the drawing of the attribute controls, it displays all non-image attributes as drop down boxes instead of the appropriate control.

 

What appears to be needed is to bring the functionality of the File Uploads/Option Types lines in "product_info.php" into Options as Images file "options_images.php".

 

Or as another approach, perhaps the image attribute type could be added to the Option Types functionality of this contribution.

 

Has anybody done either of these? Any suggestions?

 

P.S. This is on osc2.2ms2

Rule #1: Without exception, backup your database and files before making any changes to your files or database.

Rule #2: Make sure there are no exceptions to Rule #1.

Link to comment
Share on other sites

  • 2 weeks later...
  • 2 weeks later...

You would have to make two modifications to the code:

 

1. You would need to retain the extension info, so the browser would know what image it is.

 

2. You would need to change the shopping cart and/or product info pages to display the image.

 

Hth,

Matt

Always back up before making changes.

Link to comment
Share on other sites

There are instructions for that somewhere (maybe in the HTML file that comes with the distribution? I remember writing them...). Basically, you change the code in includes/application_top.php to save the file as something like 1-imagename.ext rather than 1 (where 1 is the files_uploaded_id). You want to leave the files_uploaded_id so that you don't get conflicts between different images that happen to have the same name (the original version of the contribution overwrote the images in that case).

 

Hth,

Matt

Always back up before making changes.

Link to comment
Share on other sites

Hello, I am installing Upload option and I am getting this

 

Error: destination (/hsphere/local/home/mosaic/mosaicartkeepsakes.com/catalogimages/uploads/) does not exist.

 

and I read Matt coments on it i.e.

 

Add a trailing / to the DIR_FS_CATALOG definition

 

I am not sure what does trailing means here ... can some one help me ....

 

The parameter I have to change is

 

define('DIR_FS_UPLOADS', DIR_FS_CATALOG . DIR_WS_UPLOADS);

 

Thanks

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...