How to upload file from external URL into posts programmatically - wordpress

Ive custom content type, added by bods, and Ive added a file field, that should save a pdf file from external URL
how to save it programmatically ?
I Know how to save the image but seems that the files have different approach

Related

Display a pdf file entered as a custom field file

Please i've added custom field to my portfolio posts, one of the field should be a pdf file, i'm using avada theme wordpress, and i need to create a custom layout of all my portfolio pages, i would like to dynamicly display my pdf files and the user should be able to see them on the portfolio page.
I've tried to use Custom field dynamicly and to display the field as an array, but all that i keep having on the frontend is just the pdf url. i've tried to use the pdf custom field as an embeded field too and i've installed the embeded pdf plugin but the results are the same. Please if anyone can help thaank you

Wordpress embed pdf automatically after upload via media

I want to upload pdf files via media->add new which should be automatically embedded to a unique page for displaying it. So that I can just give that page link to my client to view the uploaded pdf.
Please help me.
I am not sure what you mean by "embedded to a unique page"
But when you upload a file in Wordpress, it gives you the direct URL to the uploaded file in many locations .
You can simply give that URL to anyone you desire.
and also in the Edit Media screen
As well in other places as well - > But I think you get the point .

Opening pdf in DotNetNuke

I have a pdf file uploaded from the filemanager, this file must be shown in a new tab when a user clicks on the download button.
For now I just create the link manually, because I don't know how else I could do it.
Is there any other way to do this (for example via the settings page)?
You could add a link to the PDF in the DNN Navigation Menu by adding a new Page, but in the URL options for the page point to the PDF file, instead of an actual DNN page.

custom module in Drupal 6.26

I am working in Drupal 6.26. I am developing a custom module, in which i am i want to upload file in node creation page. I want an option to upload image, like there should be file upload component and a upload button. So when admin select a file and click on submit button file has to get saved in a folder and need to save the path in database. After upload the image thumbnail should appear with remove button. When the admin clicks on remove button the image thumbnail should disappear and file upload component has to displayed with upload button. On save of the node, the image path has to map with node. This is similar to cck file upload option. Please help me to do this. Thanks.
this would be a complex form using AHAH (AJAX) behaviour to both get the thumbnail displayed and the remove button functionality.
I would recommend starting off by studying the File upload and CCK code so you can define simple form using the Form API and then adding to it some AHAH magic.
You can get a good example of a AHAH module in Drupal 6 here

how to display a document in my aspx page

My apsx page basically displays the product description.
A user designs his own classified add and the description is displayed on an aspx page as he has designed it. To make the description more elaborate and instead of designing more components I thought that user should design an additional file (catalog of his product) and upload that at the time of designing the advert.
Now what format of file should I allow the user to create a catalog and how to show the file in the same description page? Can I use update panel? iframe?
You can ask the user to upload PDF file and use iframe to show it.
Basic example
PDF is very popular these days and most people have reader installed including plugins for their browser.
Edit: also possible to ask them for either PDF or Word file (.doc) and in case of Word document convert it to PDF on the fly.

Resources