media library – Does using the WordPress Import tool still include attachment data if “Download and import file attachments” is not selected?

I’m in a unique situation where I have to import WordPress content into a production server, but I don’t have SSH access to the server files or database. I can’t install plugins on the production server, so I am limited to the built-in WordPress Importer tool.

I don’t have any issues bringing over Posts and Pages, but it’s extremely hit or miss when bringing over the Media Library, of which I have something like ~2000 items.

What I do have, however, is access to the S3 bucket where the production server hosts the Media Library. The production server also automatically rewrites URLs for the media library to point to the S3 bucket.

My question is: If I migrate my Media Library files to my S3 bucket beforehand, then use the WP Exporter tool to export “All content” from my source site and import it into my production site and leaving “Download and import file attachments” unchecked, will my Attachment data (not the files themselves) still be imported into the database?

sharepoint online – microsoft graph api for share point to get attachment

I made a call like
https://graph.microsoft.com/beta/sites/4development106.sharepoint.com:/sites/DBSchenker:/lists/OEC_Docs?select=id,name,lastModifiedDateTime&expand=items(expand=fields(select=Title,Attachments))

and the response came as

  {
    "@odata.context": "https://graph.microsoft.com/beta/$metadata#Collection(microsoft.graph.list)(id,name,lastModifiedDateTime,items(fields(Title,Attachments)))/$entity",
    "@odata.etag": ""a2b82575-6781-4c1e-9376-0cb9865a5f12,1"",
    "id": "a2b82575-6781-4c1e-9376-0cb9865a5f12",
    "lastModifiedDateTime": "2018-10-30T01:04:25Z",
    "name": "OEC_Docs",
    "items@odata.context": "https://graph.microsoft.com/beta/$metadata#Collection(microsoft.graph.list)('a2b82575-6781-4c1e-9376-0cb9865a5f12')/items(fields(Title,Attachments))",
    "items": (
        {
            "@odata.etag": ""02115e22-f23a-4259-8ed6-daf8c43281ac,2"",
            "createdDateTime": "2018-10-30T01:04:25Z",
            "eTag": ""02115e22-f23a-4259-8ed6-daf8c43281ac,2"",
            "id": "1",
            "lastModifiedDateTime": "2018-10-30T01:04:25Z",
            "webUrl": "https://4development106.sharepoint.com/sites/DBSchenker/Lists/OEC_Docs/1_.000",
            "createdBy": {
                "user": {
                    "email": "vik.kumar@4development106.onmicrosoft.com",
                    "id": "7e2e677e-9869-42a7-af35-7b9f2a64438a",
                    "displayName": "Vik Kumar"
                }
            },
            "lastModifiedBy": {
                "user": {
                    "email": "vik.kumar@4development106.onmicrosoft.com",
                    "id": "7e2e677e-9869-42a7-af35-7b9f2a64438a",
                    "displayName": "Vik Kumar"
                }
            },
            "parentReference": {
                "siteId": "4development106.sharepoint.com,c0dcbfd8-d394-4b66-9292-d98b8d05be42,79ff79ae-9fc1-44e2-84f6-405f835b60cf"
            },
            "contentType": {
                "id": "0x010046F955EDF3E8184B9934ABF6AE97CF33",
                "name": "Item"
            },
            "fields@odata.context": "https://graph.microsoft.com/beta/$metadata#Collection(microsoft.graph.list)('a2b82575-6781-4c1e-9376-0cb9865a5f12')/items('1')/fields(Title,Attachments)/$entity",
            "fields": {
                "@odata.etag": ""02115e22-f23a-4259-8ed6-daf8c43281ac,2"",
                "Title": "Test Attachment",
                "Attachments": true
            }
        }
    )
}

i can get title here but how do i get the link to the actual attachment? attachments field just indicate if there is one associated but not the actual one.

How to show gallery in image attachment page?

Advertising

y u no do it?

Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

Starts at just $1 per CPM or $0.10 per CPC.

Group Google Forms attachment by field value

I am going to have participants fill out a Google Form with attachments. I then want someone else to be able to able to fill out a separate form and upload more attachments. I want all of those attachments to be grouped together based on one field.

So for example, John Doe will fill out his application and upload his documents. Then his three references will fill out a separate form and upload their docu. I want to be able to automate these files all being grouped together in one folder based on the name field or last name field of the form.

Is this possible? I have never worked with customizing G Suite products before, but I want to be able to streamline the scholarship application process for a non-profit I volunteer for.

Thanks!

python – Store attachment directly in dataframe Outlook

I am trying to save the contents of an email that I receive on a weekly basis:

  • Sender email address: XYZ@mena.com
  • Attachment – There is one .xls file

I want to read the contents of this attachment into a dataframe without saving it. This is what I have so far:

Outlook = win32com.client.Dispatch("Outlook.Application")
olNs = Outlook.GetNamespace("MAPI")
Inbox = olNs.GetDefaultFolder(6) #default folder is inbox
val_date = datetime.date.today() #getting attachments for today's date only

Filter = ("@SQL=" + chr(34) + "urn:schemas:httpmail:textdescription" +
                    chr(34) + " Like '%VIRGIN MEGASTORE%' AND " +
                    chr(34) + "urn:schemas:httpmail:hasattachment" +
                    chr(34) + "=1")

Items = Inbox.Items.Restrict(Filter) #filter the emails based on subject and if it has one attachment

for Item in Items:
    if Item.Senton.date() == val_date:
        for attachment in Item.Attachments:
            if attachment.FileName == "GV2020_Store.xls":
                print(attachment.content)
                my_excel_file_in_bytes = attachment.content
my_excel_file_io = io.BytesIO(my_excel_file_in_bytes)
pandas_data_frame = pandas.read_excel(io=my_excel_file_io)

This returns the following error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-101-42fa8005b43a> in <module>
     43         for attachment in Item.Attachments:
     44             if attachment.FileName == "GV2020_Store.xls":
---> 45                 print(attachment.content)

~Anaconda3libsite-packageswin32comclientdynamic.py in __getattr__(self, attr)
    525
    526                 # no where else to look.
--> 527                 raise AttributeError("%s.%s" % (self._username_, attr))
    528
    529         def __setattr__(self, attr, value):

AttributeError: <unknown>.content

magento2.3 – Email Attachment not working in magento 2.3.4 contact us email

I’m using magento 2.3.4

i customized contact us magento 2 module(Magento_Contact)

i want to Attach file in Email

i followed this blog post

How to Add Attachments with Email in Magento 2.3.x

but

Create TransportBuilder.php file at VendorModuleModelMailTemplateTransportBuilder.php

this file

protected function prepareMessage()
    {
        parent::prepareMessage();
        $this->message->setPartsToBody();
        return $this;
    }

$this->message =>changed to MagentoFrameworkMailEmailMessageInterfaceFactory;

this class

getting error

Call to undefined method
MagentoFrameworkMailEmailMessageInterceptor::setPartsToBody()

mysql – Create a CSV from SQL Data and email as attachment using PHP

I put together some functions that allows a PHP script to send the SQL data obtained from user inputs on a website via an email attachment as a CSV file. It works perfectly and I have no issues with the code. Alternatively with the right SQL query it would run every X amount of days with a cron job and only produce the data within a specific criteria such as every month.

The idea behind the code is for users that cannot extract their data from SQL and have limited experience running their businesses online. I would like some input from what I have put together from scripts and endless amounts of testing to see if the code is up to standard.

Firstly I create the fileName:

  function fileName()
{
    $path     = "csv/";
    $filename = "Subscribers" . date('Ymd') . ".csv";
    $filepath = $path . $filename;
    return $filepath;
}

After which I create the CSV file:

function createCSV()
{
    include_once "conn.php";
    global $conn;
    
    $filepath = fileName();
    $output   = fopen($filepath, "w");
    fputcsv($output, array(
        'Name',
        'Email',
        'Date Joined'
    ));
    $query  = "SELECT name, email, dateTime FROM tableData";
    $result = mysqli_query($conn, $query);
    while ($row = mysqli_fetch_assoc($result)) {
        fputcsv($output, $row);
    }
    return $output;
    fclose($output);
    
}

Followed by the code I cut and edited from a thread online for attaching the CSV using the built in mail function:

function sendCSV()
{

// Recipient 
$to = 'recipient@email.com';

// Sender 
$from     = 'sender@example.com';
$fromName = 'Test';

// Email subject 
$subject = 'PHP Email with Attachment';

// Attachment file 
$file  = fileName();
$files = glob('csv/*.csv');
unlink($files);

createCSV();

// Email body content 
$htmlContent = ' 
<h3>PHP Email with Attachment</h3> 
<p>This email is sent from the PHP script with attachment.</p> 
';

// Header for sender info 
$headers = "From: $fromName" . " <" . $from . ">";

// Boundary  
$semi_rand     = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";

// Headers for attachment  
$headers .= "nMIME-Version: 1.0n" . "Content-Type: multipart/mixed;n" . " boundary="{$mime_boundary}"";

// Multipart boundary  
$message = "--{$mime_boundary}n" . "Content-Type: text/html; charset="UTF-8"n" . "Content-Transfer-Encoding: 7bitnn" . $htmlContent . "nn";

// Preparing attachment 
if (!empty($file) > 0) {
    if (is_file($file)) {
        $message .= "--{$mime_boundary}n";
        $fp   = @fopen($file, "rb");
        $data = @fread($fp, filesize($file));
        
        @fclose($fp);
        $data = chunk_split(base64_encode($data));
        $message .= "Content-Type: application/octet-stream; name="" . basename($file) . ""n" . "Content-Description: " . basename($file) . "n" . "Content-Disposition: attachment;n" . " filename="" . basename($file) . ""; size=" . filesize($file) . ";n" . "Content-Transfer-Encoding: base64nn" . $data . "nn";
    }
}
$message .= "--{$mime_boundary}--";
$returnpath = "-f" . $from;

// Send email 
$mail = @mail($to, $subject, $message, $headers, $returnpath);

// Email sending status 
echo $mail ? "<h1>Email Sent Successfully!</h1>" : "<h1>Email sending failed.</h1>";
}

I am quite new to PHP but managed to put something together that actually works. If you can point out my mistakes (which I do know there would be), or guide me to more simple techniques, I would really appreciate it and it will help me progress in my PHP learning path.

import CSV attachment from gmail to google sheets

I receive a daily email with an attachment. I have the options of a CSV attachment or xlsx attachment. I currently and working to import the attachment into google sheet from my Gmail. I have attempted the script below and only receive the result “PK” in the first cell of the google sheet. The result should be a spreadsheet with many columns and rows. I am new at this and need help to make this code work. My plan is to set a trigger that will run this script every day and replace the old data. Can anyone recommend a code that will work with CSV or XLSX?

Google Apps Script send attachment on cell value

i know this is an old post but this answer is for anyone else looking for the same solution to a similar problem quite recently.

The solution is simple

there are two parts to this

first you need to get the sheet to trigger & run a script code based on a cell value.

https://developers.google.com/apps-script/guides/triggers

you need to modify the code above to run on a specifc cell value not on the whole sheet onChange() trigger will run on any changes to the sheet so that will not work unless your code is designed to run and query that specific cell value everytime the trigger is activated.

to better understand what i mean look at the code for conditional formatting

the code below will change the cell color based on the value that has been inputed into the cell – in this case its looking for numbers 0-10 but you can easily modify this code to look for a word insted of a number like in the example i mentioned below the specific word “salary” that will trigger a code to send an email to finance with a excel file attachment “accounts .xls”.

/ Adds a conditional format rule to a sheet that causes cells in range A1:B3 to turn red if
// they contain a number between 1 and 10.
var sheet = SpreadsheetApp.getActiveSheet();
var range = sheet.getRange(“A1:B3”);
var rule = SpreadsheetApp.newConditionalFormatRule()
.whenNumberBetween(1, 10)
.setBackground(“#FF0000”)
.setRanges((range))
.build();
var rules = sheet.getConditionalFormatRules();
rules.push(rule);
sheet.setConditionalFormatRules(rules);

full example here

https://developers.google.com/apps-script/reference/spreadsheet/conditional-format-rule-builder?hl=ID

the cell value should contain the specific keyword received from the google form.

for example if the word “salary” is entered onto the google sheet from the form into cell A1 – with your trigger set – to run on cell A1 change the code will run looking for the specific word “salary” in cell A1 – if the word “salary” is found it will call the second part of the code – i.e. is to perform the action of sending out an email via scripting to the specified receipents along with the attachment assuming you have the same stored in your google drive folder- in this case “accounting.xls” to the finance team.

codes to send emails & attachments from google drive:

https://developers.google.com/apps-script/reference/mail/mail-app

https://developers.google.com/apps-script/articles/sending_emails?hl=en

https://developers.google.com/apps-script/quickstart/forms

https://developers.google.com/apps-script/reference/drive/drive-app

Attachment manager | NulledTeam UnderGround

Description:

Adds a line feed between each embedded attachment.

This add-on improves the appearance of posts with multiple attachments. By adding a line feed between each embedded images, it makes it easier to identify each image and also makes adding a description easier for the author.

(Example before add-on is installed)

(Example after add-on is installed)…