Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Create Downloadable Products. How Find Server Location Of Uploaded File? Rate Topic   - - - - -

 
  • al-bert
  • Member
  • Trial users
  • Join Date: 27-Jul 18
  • 45 posts

Posted 29 October 2018 - 04:05 PM #1

Once I create a digital product and I upload a digital file (using, Files to Sell), how can I know the location of digital file in var/downloads?

 

Do I have to do an FTP file search?

 

Is there a "simple" way to know the location where file was uploaded in the var/downloads/ "tree"?

 

Any solutions?



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11203 posts

Posted 29 October 2018 - 07:41 PM #2

I guess first thing to ask is "why" is the location needed?

Are you concerned that it is not creating an exact representation f what you uploaded?

 

But I believe it becomes var/downloads/[PRODUCT_ID]/[FILENAME]


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • al-bert
  • Member
  • Trial users
  • Join Date: 27-Jul 18
  • 45 posts

Posted 31 October 2018 - 04:15 PM #3

I guess first thing to ask is "why" is the location needed?

Are you concerned that it is not creating an exact representation f what you uploaded?

 

But I believe it becomes var/downloads/[PRODUCT_ID]/[FILENAME]

 

The location is needed because it is the way I have worked in my store and makes for smoother work flow.

 

Yes, I am aware the CS-Cart default upload directory/tree path, thanks for pointing that out though.

 

I have noticed that the 3 things I need are located in cscart_product_files Table, and those are:

1) PRODUCT_ID (the folder created by CS-Cart)

2) FILE_PATH (name of distro file) and,

3) FILE_SIZE (obvious).

Perhaps it is also located in another table, I don't know, I'm not a programmer.

 

My question, is it too difficult to make an addon (so as not to alter core code) that would take this info from the table and add it to my order page?

 

Product ID: 123

File Path:     DigitalFile.zip

File Size:     15,243771

 

Thanks!

 

BTW, using 4.8.2.sp2



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11203 posts

Posted 31 October 2018 - 09:14 PM #4

No, it's not technically difficult.

 

You need to consider that there may be more than one file available per product hence if you have a product with multiple files, you may want to display them all.

 

It's probably an hour or two to implement to display on your admin orders page. 

 

If you want it on email invoices, then for the new email editor you'd need to factor in about 3X the time as it would take to do it in the original template based emails.  For example it might take 1/2 hr for the original template email invoice and 1.5-2hr to do it in the new email editor.  Note that admin and customer emails are different so you'll need to factor that in when figuring out how long it's going to take to implement in email invoices.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • al-bert
  • Member
  • Trial users
  • Join Date: 27-Jul 18
  • 45 posts

Posted 01 November 2018 - 02:49 PM #5

Great idea, as I will have a few product variations, good catch.

 

 

I've sent you a message, thank you!



 
  • Mr.Croquet
  • Advanced Member
  • Trial users
  • Join Date: 22-Nov 13
  • 67 posts

Posted 15 January 2019 - 05:35 PM #6

I have a similar problem (I think) with my first attempt at selling digital products. My product is a series of videos ranging in size from 19 MB to 67MB. The max file upload size is 8MB so I uploaded them via FTP to /var/downloads/125

 

Now that they're on the server, I need to add them to the list of 'Files to sell'. I'm now trying to locate these files on the server or should I be trying to determine a URL for them?

 

Any suggestions?



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11203 posts

Posted 15 January 2019 - 06:36 PM #7

I would suggest that you create a folder in the root of your store to upload these large files to.

Then use the URL option to have it use HTTP to get those files and put them in the right place Ie.. https://yourdomain.c...lder/foo.mpg". Alternatively, you could have the files on a different server and simply upload them from there as well.

.  

You'll then have confidence that all the related business rules, permissions, etc. are correct for your customers to retrieve the files after purchase.

 

This "method" will insulate you from any future changes that may occur to file locations.

 

Generally files for products are uploaded from "server" from var/files/[company_id] I believe. Personally, I think they should have made it so that any URL within the storefront can be used for uploads rather that a specific base directory. But....


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18928 posts

Posted 16 January 2019 - 06:11 AM #8

You can hire someone to create a script for which will be run by cron. It will scan var/downloads/ directory and attache corresponding files to products without uploading


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • Mr.Croquet
  • Advanced Member
  • Trial users
  • Join Date: 22-Nov 13
  • 67 posts

Posted 16 January 2019 - 04:29 PM #9

Thanks EZ and eComLabs. I got it working using the existing /var/downloads/125 folder and the URL option to select the file.

 

Next hurdle is that the product is a series of instructional videos that are copyrighted. The e-mail that goes to the customer includes a link to all those files. There's nothing stopping the buyer from passing them along to all their friends. The links remain intact in a forwarded e-mail. Is it possible to NOT include those in the e-mail?

 

Also, I specified a max number of downloads to 2 but the e-mail links seem to not care about that. I've opened and played the video 4+ times. Any thoughts here?



 
  • tbirnseth
  • CS Cart Expert
  • Authorized Reseller
  • Join Date: 08-Nov 08
  • 11203 posts

Posted 16 January 2019 - 04:56 PM #10

You can set them to a single download rather than unlimited.  This will allow them to download the files once.

That still won't prevent them from distributing the files themselves.  But if you're clear on copyright then they would be consciously breaking the law.  You could use other software to ensure that when opened the first time, they are tied to a specific device. But that's outside the scope of cs-cart.


EZ Merchant Solutions: Custom (USA based) B2B Development, Consulting, Development and Special Projects (get a quote here).
Commercial addons, payment methods and modifications to meet your business and operations needs.


 
  • Mr.Croquet
  • Advanced Member
  • Trial users
  • Join Date: 22-Nov 13
  • 67 posts

Posted 16 January 2019 - 05:14 PM #11

I have the downloads set to 2. I could set it to 1. The real problem though is that the video links are included in the notification e-mail. I don't want to shut off everyone's notifications for their orders. How can I get it off the e-mail?



 
  • al-bert
  • Member
  • Trial users
  • Join Date: 27-Jul 18
  • 45 posts

Posted 16 January 2019 - 07:47 PM #12

Thanks EZ and eComLabs. I got it working using the existing /var/downloads/125 folder and the URL option to select the file.

 

Next hurdle is that the product is a series of instructional videos that are copyrighted. The e-mail that goes to the customer includes a link to all those files. There's nothing stopping the buyer from passing them along to all their friends. The links remain intact in a forwarded e-mail. Is it possible to NOT include those in the e-mail?

 

Also, I specified a max number of downloads to 2 but the e-mail links seem to not care about that. I've opened and played the video 4+ times. Any thoughts here?

 

I wouldn't worry about that since they can still copy the links and still distribute them. So they don't appear in the email, perhaps editing the email template that sends them?

 

The way I am using to locate the folder, is I locate the product, in admin end, hoover my cursor over the product and see the full URL in the bottom of the browser, including the id "...&product_id_123, maybe there is an easier way.

 

Would be good if one could restrict -as an option- the download to the IP that made the purchase, but then, that may bring other issues to both customer and vendor in support emails as customer may wish to download form another location.

 

Just my 2 cents Mr.Croquet



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 18928 posts

Posted 17 January 2019 - 05:59 AM #13

I have the downloads set to 2. I could set it to 1. The real problem though is that the video links are included in the notification e-mail. I don't want to shut off everyone's notifications for their orders. How can I get it off the e-mail?

 

Go to Design -> E-mail templates and disable the "Orders: access to downloadable products" template or correct the template to exclude links to files


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration | UniTheme and YOUPI
CS-Cart                USD 345     Multi-Vendor              USD 1250    CS-Cart RU                         24500 руб.
CS-Cart Ultimate  USD 775     CS-Cart + YOUPI      USD 545      CS-Cart RU + UniTheme    36000 руб.


 
  • Mr.Croquet
  • Advanced Member
  • Trial users
  • Join Date: 22-Nov 13
  • 67 posts

Posted 28 January 2019 - 04:38 PM #14

Next challenge on the way to a smooth transaction with the customer.

 

The files on the server range from 8MB to 67MB. When I download any of them individually, via FTP, they download cleanly and open up. They are MP4 format except for one PDF user guide.

 

However, when I buy them and go to my downloads (as a customer), 4 of the files show as either 273 KB or 253 KB. What would cause them to corrupt when going through CS Cart? I deleted the problem files and uploaded them again but it remains the same.

 

Is this a known problem or does anyone know what's happening with just those 3 files?



 
  • Mr.Croquet
  • Advanced Member
  • Trial users
  • Join Date: 22-Nov 13
  • 67 posts

Posted 28 January 2019 - 04:45 PM #15

Oops! Correction on the corrupt file's sizes. They weren't 273/253 KB, they were 273/253 bytes.