How to access the images/videos from another location (windows + disk E) in PHP? [closed] - php

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
We have one .net application in which there is facility to upload images in given storage location. our application is completely windows based. and what it does is it stores images on given path for example "E:\Images".
On the other hand We are using using PHP application (using smarty framework) to display all our uploaded data. In this case everything working fine except images as the storage location is not within the PHP application directory.
I know with the help of symbolic link we can access the images from another disk. It is also working. But if we change the storage location later on then there will be a problem.
I also know that using base64 way we can access images. But it is taking too much time to load If I have a 30 images for one single record.
Can you please suggest a good way how can I access the images? Or how we can improve our symbolic link way?

PHP can access any area of the disk ifallowed. You may need to configure open_basedir to allow such access.

Related

PHP how to simply upload video to server [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I want to simply upload a video (MP4) to a folder on the website using PHP and be able to retrieve it. I searched several websites and questions on stackoverflow and all of them have not worked for me.
Without any code examples, it is kinda hard to answer, but here is something you can use as a starting point.
http://www.w3schools.com/php/php_file_upload.asp
Once you can get the file to upload to your PHP script (in temp storage on the server), you can then use PHP functions to move the file to a folder, or insert it into a database.
Be aware, the example is simple, and not super secure. You will want to enforce limiting mime types and file sizes to start.
If you get some code written and have issues, I would suggest updating your question so we can help.
You may run into a few issues with uploading.
Server permissions
File Size Limits
Folder permissions to put the file.
Note: The example I gave you is for images, but just look through it because obviously you can't use
getimagesize()
on a video.
You should be able to use this instead:http://php.net/manual/en/function.filesize.php
I would first focus on getting a basic, secure uploader working. From there you can do specific video stuff.
Good luck.

How can I use a script to convert a .wav and .webm saved on server into a .mp4 and save it on the server [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
Ok. So I have a website where I use a form to record information on the user and store it in a MySQL database. After you submit the form, it opens a page where there is a video and audio recorder setup. (At the top of this file, in the php, it also handles the form input.) So I have this part all done and it is working perfectly. The only problem is that the video/audio recorder saves two files which are named after the user who submitted the form, a .webm with video, and a .wav with the audio. What I want to do is make a script that combines the two into one .mp4 or .avi. The plugin I used for the recording is Here. I just want some advice on where to start. I am also fine with using some kind of plugin or something, because it is a private project.
PHP can't be used to do audio/video files conversions. To achieve what you want you have to use FFmpeg which is a command-line tool that runs on Linux and Windows.
If you don't have a least a VPS or dedicated hosting, there is no chance that your shared hosting provides this library.
With a small search on the internet I've found that: https://github.com/PHP-FFMpeg/PHP-FFMpeg

Wordpress: How to change all existing media paths?

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 days ago.
Improve this question
so recently i discovered amazon web services and decided that this is my future. What i have done i exported all media to my pc and uploaded to amazon s3 storage made bucket public and now i need to change all urls on my wordpress that it would read from amazon.
So what i need to know how is that possible, i know that via sql update is one way to go also you can write small php code to do it and there is also couple of plugins that actually transfers your media to amazon s3 but those ones was outdated.
So i have now media like this:
mydomain.com/wp-content/uploads/2015/03/myphoto.jpg
Wat i need is change path to:
amazondomainandbucket.com/wp-content/uploads/2015/03/myphoto.jpg
I have amazon subdomian, i alrerady uploaded all my uplodas folder in it i have couple ways to go which i wrote above but just looking for good advice maybe there existing some plugin which is able to do that? Im using newest wordpress version 4.1.1 (i believe its this)
Thank you.
You should run string replace befor uploading the database.
dump the database
open the file in notepadd++ (or similar)
replace all urls and save
import the database

how can I create a really simple upload - download website [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I am attempting to collect files from a number of friends from around the world. Later on I will also allow everyone to download from this shared repository.
Some key facts:
Most of them have little knowledge for file transfer and even less motivation to "try". So they will stop caring to upload files if I tell them to install some ftp/webdav client and give them detailed info on how to send files.
I have a high server to my disposal where I could setup a webserver that can do multiple file upload/download.
the data size will be considerable so I can not use one of available free services (such as dropbox etc.)
I have zero knowledge regarding webpage programming.
So I would like to create an extremely lightweight page (hopefully an html page is enough), where there is some introductory text, underneath I can see the files that exist in the current directory and finally have an "upload" button so as to allow people to upload files (multiple files!).
A possible page could be similar to this http://taper.alienbase.nl/mirrors/. As you can see there exists some text and the current folder contents. There exists no upload capability however. Also If a folder is completely empty (no index.html etc) , apache decides automatically to create an 'ls table' of the current directory contect.
Is there any easy code that implements file upload? I read about plupload here but it seems somewhat more complicated (it also requires java? - I didn't find any setup info)
I want to set it up on an apache webserver, in a linux box.
If you have a tutorial in mind that may give installation and setup information about how to set it up, it would be very helpful.
I have previously used this jQuery Upload File Plugin. Its simple to implement and has the option to drag and drop multiple files for upload.

Automatically saving doc file after 20 secs [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
i am doing a php program which requires doc file to be saved after every 10 secs.msword should not ask the path to be saved. actually i have written a program which opens a doc file. the file should be auto saved to the exact location from where the file is opened.
If I understand you correctly, what you want to do is not possible (sadly).
There is no standard or protocol for live editing of remote files that have been downloaded from a web page in a browser. The file will be downloaded to a temporary location and opened from there.
Hence, any notion of providing an auto-save mechanism from PHP or JavaScript is completely impossible. The client application will have to do that.
If you want to upload the downloaded and locally edited file back to the web site, you will need to provide an upload form for the user to do it manually. (Which is a shame and completely unintuitive, but that's the way technology is at the moment.)
Not possible due to security reason in web technology.

Categories