1. David Harding
  2. Joomla! Extensions
  3. Wednesday, 29 August 2018
Hello All - my first post!

Joomla: 3.8.11 - with FTP enabled and checked working
Virtuemart: 3.2.14


I bought a licence for the Simple File Upload Plugin for Virtuemart and have installed and enabled it as a plugin in Joomla and set it up as a custom field in Virtuemart in order for customers to upload their logo when they place an order.

I am having problems uploading the logo images either as: .jpg/.jpeg .png or .gif formats.

1. The file upload custom field title 'Send us your logo' is printed OK along with the other fields on the cart/basket page.

2. I am assuming that the logo is supposed to appear on the cart/basket page alongside the field title - but it is missing.

3. I think I have the paths set correctly, because the dedicated image folders are being created and labeled with the customer order number with a blank .html page inserted. But as I say, no images are being uploaded.

4. The orders come through OK, with the 'Send us your logo' text but without the logos.

Has anyone else experienced similar problems with Simple File Upload? I have looked all over the 'net but can find no solution.

Any solutions or advice would be welcome!

Regards

David H
Responses (11)
David Zirhut Accepted Answer Pending Moderation
Can you post here the screenshot of your setting?

Linelab Support
  1. more than a month ago
  2. Joomla! Extensions
  3. # 1
David Harding Accepted Answer Pending Moderation
Hello David

Thanks for your quick response - much appreciated.

I've attached images of the settings for the custom field main setting, also the individual product settings, and the Joomla plugin setting.

I was wondering earlier if the VM cart template needs a snippet/placeholder added for the image to display in?

Hope that helps!

Regards

David

custom_field_settings_1.png custom_field_settings_2.png
Attachments (2)
  1. more than a month ago
  2. Joomla! Extensions
  3. # 2
David Harding Accepted Answer Pending Moderation
Two more here David

I should just mention: The path is /home/astraimps/public_html/images/stories/virtuemart/customerlogos - which as I say, does create the correct customer folder.

Thanks for your help

David

joomla_plugin_settings.png product_custom_field_setting.png
Attachments (2)
  1. more than a month ago
  2. Joomla! Extensions
  3. # 3
David Zirhut Accepted Answer Pending Moderation
Setting should be ok.

Attaching the file to the order is in 2 steps.
1) after choose the file from your computer, the file is immediately uploaded to the server into temporary directory defined in configuration php ( possibly: /home/astraimps/public_html/tmp/fileinput ).
Check if new file (temporary named) appears here. Is not, check the permitions to the tmp directory
2) if point 1 is ok, then the second part is probably wrong. It's when the order is finished. Check the permitions to your directory also
  1. more than a month ago
  2. Joomla! Extensions
  3. # 4
David Harding Accepted Answer Pending Moderation
Hello David

Thanks for getting back to me.

The /home/astraimps/public_html/tmp/fileinput folder does exist - I hadn't realised that it should have been there - sorry!

Both the /tmp/ folder and /tmp/fileinput/ folder permissions were 755, so I changed the /filieinput/ folder to 777 and tried the upload file function again via the product page, but still no luck I'm afraid.

I have attached the source code on the products page for the Send us your logo field before clicking on the Add to cart button.

Also, the source code on the cart/basket page after the product has been added to the cart.

The image name doesn't appear anywhere in the source code on either of them. I've attached the source code generated for the Send us your logo field on both the product page and the cart/basket page.

Ah, I looks like I can't attach .txt files so basket page source code:

<br /> <span class="product-field-type-E"><span>Send us your logo </span></span><br />

There are working fields both before and after...

Any ideas?

Kind regards

David
  1. more than a month ago
  2. Joomla! Extensions
  3. # 5
David Harding Accepted Answer Pending Moderation
Hi David

I thought I'd try to include the source code in my reply above - to see if it's accepted. So here's the product page source code after the image has been selected - with the filename displaying to the right of the browse button - it's a bit longer:

<div class="product-field product-field-type-E">
<span class="product-fields-title-wrapper"><span class="product-fields-title"><strong>Send us your logo</strong></span>
</span>
<div class="product-field-display">
<input class="vmcustom-fileinput"
type="file"
name="file_upload"
custom_id="97"
customfield_id="14506"
>
<input class="vmcustom-fileinput"
type="hidden" value=""
id="virtuemart_customfield_id_14506_filecode"
name="customProductData[891][97][14506][tmp_filename]"
>
<input class="vmcustom-fileinput"
type="hidden" value=""
id="virtuemart_customfield_id_14506_filename"
name="customProductData[891][97][14506][filename]"
><br />
<span id="virtuemart_customfield_id_14506_error" style="display: none; color:red;">ABCD</span>

<script>
jQuery( document ).ready(function( $ ) {
// Variable to store your files
var files;
var session_id='fd779af5301fd20d76af0a24c49fc228';
// Add events
$('.vmcustom-fileinput').on('change', prepareUpload);
// Grab the files and set them to our variable
function prepareUpload(event)
{
formProduct = $(this).parents("form.product";);
virtuemart_product_id = formProduct.find('input[name="virtuemart_product_id[]"]').val();
Virtuemart.setproducttype(formProduct,virtuemart_product_id);

files = event.target.files;
// Create a formdata object and add the files
var data = new FormData();
$.each(files, function(key, value)
{
data.append(key, value);
});
data.append('session', session_id);
data.append('custom_id', $(this).attr('custom_id'));
data.append('customfield_id', $(this).attr('customfield_id'));
data.append('lang', 'en-GB');

$.ajax({
url: 'http://www.astra-imprints.co.uk/plugins/vmcustom/fileinput/upload.php?files',
type: 'POST',
data: data,
cache: false,
dataType: 'json',
processData: false, // Don't process the files
contentType: false, // Set content type to false as jQuery will tell the server its a query string request
success: function(data, textStatus, jqXHR) {
if(data.error == 0) {
console.log(data.filecode);
$('#virtuemart_customfield_id_'+data.customfield_id+'_error').css('display','none');
$('#virtuemart_customfield_id_'+data.customfield_id+'_filecode').val(data.filecode);
$('#virtuemart_customfield_id_'+data.customfield_id+'_filename').val(data.filename);
} else {
$('#virtuemart_customfield_id_'+data.customfield_id+'_error').css('display','inline');
$('#virtuemart_customfield_id_'+data.customfield_id+'_error').text(data.message);
}
},
error: function(jqXHR, textStatus, errorThrown) {
$('#virtuemart_customfield_id_'+data.customfield_id+'_error').css('display','inline');
$('#virtuemart_customfield_id_'+data.customfield_id+'_error').text(textStatus);
// STOP LOADING SPINNER
}
});
}

});

</script>
</div> </div>

Hope that helps!

Kind regards

David
  1. more than a month ago
  2. Joomla! Extensions
  3. # 6
David Zirhut Accepted Answer Pending Moderation
Can you check the right setting of "Path to temp folder"?
Usually it's the tmp in root of you installation - so in your case it might be /home/astraimps/public_html/tmp
The directory fileinput is created automatically there.
Attachments (1)
  1. more than a month ago
  2. Joomla! Extensions
  3. # 7
David Harding Accepted Answer Pending Moderation
Hello David

Yes, tmp folder exactly as you suggest above - see attached - /home/astraimps/public_html/tmp

I've also included an image of the Joomla sys. info. permissions report, it shows that /tmp/ is writeable.

Head scratcher this one!

Regards

David

config_path_to_tmp_folder.png

joomla_file_permissions.png
Attachments (2)
  1. more than a month ago
  2. Joomla! Extensions
  3. # 8
David Harding Accepted Answer Pending Moderation
Hello David

I still haven't had any luck in getting the images to upload. I thought I'd sent you another screen shots of the custom field setting yesterday, but I must've been wrong. Here they are:

product_custom_field_setting.png

Regards

David
Attachments (1)
  1. more than a month ago
  2. Joomla! Extensions
  3. # 9
David Zirhut Accepted Answer Pending Moderation
The problem was solved after personal communication (unusual setting of the hosting).
The plugin was updated for next similar case.

Linelabox Support
  1. more than a month ago
  2. Joomla! Extensions
  3. # 10
David Harding Accepted Answer Pending Moderation
Hello David

Thanks for your excellent support ;) glad we got there in the end!

Kind regards

David
  1. more than a month ago
  2. Joomla! Extensions
  3. # 11
  • Page :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.