Contact form with file uploader solution - javascript

I'm building a website (no CMS or framework) that needs a contact form with a file uploader. I've already written a PHP script for a standalone contact form, but I'm not sure how to go about connecting it with a file uploader that will store the files on the server and will also work on mobile devices.
Since I'm not very experienced in this topic, my questions are:
Would this be too difficult to manually write and implement?
Are there any existing solutions I can use?
Considering the website is almost done (structure/design have been built), should I switch to WordPress and use a plugin? I got 3/4 into converting the HTML into a theme, but I'd really prefer to continue this way
Any advice would be greatly appreciated. Thanks!

Uploading files without a framework is made quite easy with w3's guide:
http://www.w3schools.com/php/php_file_upload.asp

Related

Can I create a WordPress plugin with JavaScript only?

I am scared to ask this question, because StackOverflow is already warning me about my question being likely to be downvoted. But I am very curious about this.
I have read that you must have at least one php file in your WordPress Plugin. Which sounds to me like you only need something like an index/entry php file.
However, I wasn't able to find much about JavaScript in WordPress Plugins by using google. Which seemed weird to me, because we're talking here about the web of 2017.
An answer would be very appreciated!
The answer is no, you cannot, as you have referenced in your question. By definition, a plugin is at the very least a "PHP file with a WordPress plugin header comment" (Wordpress Docs).
However, there is no reason a Wordpress plugin can't be primarily Javascript. You can follow this guide for some different approaches to include it in your plugin.
Since WordPress is (basically) purely php, then all its plugins will also be php. This is they way it has been set up.
In order to have a 'WordPress plugin', yes you will need at least one php file to register to WordPress and enqueue your javascript/css/what-have-you..
This means if you want something like React/Ember on your WP installation, they aren't going to be 'WordPress' plugins, they will belong to the React/Ember ecosystem. You will just have the minimum to enqueue the javascript libraries you want to use.
You can then use your javascript frontend and talk to WP's REST API, and now WP has basically become your server 'framework'.
So, no, there's no such thing as a 'JavaScript WordPress Plugin'. But you can have a plugin that includes as much fancy JS as you may want.
The following article should give you insight about this.
Your WordPress Plugin must have at least one PHP file; it could also contain JavaScript files, CSS files, image files and language files. If there are multiple files, pick a unique name for a directory and a name of your choice for the main PHP file. (This file name is often, but not essentially, the same as the directory name.) Example directory and file names could be mycompanyname-fabulous-functionality and mycompanyname-fabulous-functionality.php respectively. Put all your Plugin's files into the directory you've created and tell your Plugin users to upload the whole directory to wp-content/plugins/.
Hope this helps. But no, you can't create a Wordpress plugin with only Javascript.

Why Facebook Like button load large js files?

To integrate Facebook Like button, I included a piece of js code according to Facebook Developer guide, but found it loaded several js files, and in total, it consumes 273kb which is even larger than my SPA js.
Could anyone explain this and advice on how to reduce it?
Thanks a lot!

Programmatically generate preview of Adobe files

I am willing to programmatically generate file previews for a large set of Adobe files. This should be done programmatically (not via user interface via recorded actions).
The idea is to generate jpg/png previews for psd files, pdf preview for indd files and so on.
Is there a library or SDK to easily do that?
I am open to every programming language that can get the job done, however I prefer a js solution since I am willing to run the script on a nodeJS server.
Is there any system requirement or program to be installed to make this thing work? Do I need an Adobe subscription to do that?
Thank you in advance.
I cannot find yet a proper solution in JavaScript. But this is a reference link I found on search engines.
https://unix.stackexchange.com/questions/11835/pdf-to-jpg-without-quality-loss-gscan2pdf
With ImageMagick on a server, it may help solve the problem.
Another reference link is on about to improve the speed and reduce the memory consumption. This may also help you integrate it on your server.
https://serverfault.com/questions/167573/fast-pdf-to-jpg-conversion-on-linux-wanted
This code snippet may help you. You may have to apply back-ends on your server instead of directly integrating it in your NodeJS server.
convert -density 300 file.pdf page.jpg

Create File Upload Progress Bar ASP.NET and JavaScript

Any ideas how to create a very basic file upload progress?
It just needs to show the percentage of the file uploaded.
I've been seeing codes and plugins, but it looks very complex. I just want to try it out using WebForms to get the basics of it.
Server-side is irrelevant, it's done entirely client-side.
The simplest method is available pre-packaged for you, found with just a little bit of googling, here: http://blueimp.github.com/jQuery-File-Upload/

Implementing Tiny MCE As Local HTML Editor

UPDATE: There are stupid questions, and this is one of them. I didn't realize that serving JavaScript via Django was so large a question. When I've answered it, I'll post the most useful resources for those who want to RTFM, unless the mods close this first. Until then, sorry for wasting your time.
How do I install and configure Tiny MCE, Apache2 and Django so Tiny MCE is available as a local application only? I think what I want to do is setup Apache so it serves only the local computer, and does so with Django to provide a Tiny MCE editor. Apache2 and Django are already installed but I don't know how to integrate Tiny MCE to achieve this result.
I'm a newbie to web development and frameworks, so I might be missing an obvious solution to this problem.
(Why am I doing this?
I want a WYSIWYG HTML editor that will let me edit a document's formatting and see how that affects the HTML, and edit the HTML and see how it affects the formatting, while using a CSS stylesheet.
I will want to serve this functionality to the web over a SSL connection but don't yet want to set that up just yet.
The web application will go through Django, so I want to get things working through that framework.
I'd like to see a JavaScript application in action.)
Thanks for your patience.
UPDATE: Is this better phrased as:
How do I serve a javascript application through Django?
How do I make that service available only to the local computer?
Question #2 seems to have been answered.
Bind Apache to the 127.0.0.1 interface only. The documentation can be found at http://httpd.apache.org/docs/2.0/bind.html
What you serve is irrelvent as far as this question is concerned, since you are just trying to control where you serve it too.
In response to q.1 - you don't, normally. Django does not serve static media like JS files, images, etc. Having said that, there is a tinymce app for django which eases the integration. http://code.google.com/p/django-tinymce/ works well for me.

Categories

Resources