Run a upload in background with base64 file - php

I work with radiology medical reports. Doctors record the report in a audio file and close the browser after this, so the browser doesn't have time to upload the file. I tried to put a loading with a warning about the time to upload and the need to stay with browser open, but they don't respect it and the accuracy of loading screen is not very correct.
My question is: since I have a audio file encoded in base64, there is a way to run this upload in background or keep this to upload in another screen request?
My point is, there is a way to upload the files without any dependency of the user?
If it helps, I`m using CodeIgniter.
Thanks

Related

Dicom viewer in my php web application

I am doing one web application for my client. We have one issue. Right now we have dicom image viewer of nagoya tech dicom viewer. We have integrated that viewer in our PHP web application.
When we upload that file. File uploads successfully but we not able to see anything screen seems blank.
I don't know what specification is missing with my application. I am not able to see this .DCM image in my dicom viewer.
I am searching this for long time what is the issue but I am not able to do this.
Please help me to load image in this with all things.
Here is the image.
There seem to be two variables here to me:
Does the viewer work at all?
Is the upload successfully transferring the file?
The best way to troubleshoot this would be to put a file on the server to test with the PHP viewer IMO. If this image is viewed successfully, we can rule out a problem with the viewer itself. At this point, try uploading that same known good file through the client to then be displayed. If this fails, compare the uploaded file with the known good file for differences. If the file is 0 KB, then the uploading has failed.
If you cannot find any good file to test with, then you should verify the parsing of the file to figure out why that is failing.

Youtube-DL file download live progress

I am using the YoutubeDL library in a project. My environment is based on WINDOWS with XAMPP as the webserver boundle (apache,php,mysql,etc). I am using the youtube-dl.exe file to download the video and then use ffmpeg.exe to convert the video to an MP3 audio file.
At the moment, I have an issue related to programming: I want to show live a progressbar while the video is downloaded with the youtube-dl.exe file. This exe creates a log file, that is updated while the video is downloaded. So my approach on this was to create a PHP file, that opens, parses the log file and get's the progress percent, and sends it as a json encoded value to an AJAX function that is called every 100MS. Indeed, if the video is too large, there will be a very high ammount of data while polling the PHP file to get the progress state. And sometimes, the browser either crashes or freezes because of this ajax polling.
My question is: is there any better approach to do this with PHP/AJAX? Rathar than poll the file every 100MS, or 50MS?
Poll only every second and animate the progress bar.

how does youtube convert videos to mp4/flv when uploading the video

Hi i'm making a site in wordpress using a theme called wptube2 and it has all the Youtube look and stuff but what I need is that when I upload some video it just uploads I want it to be able to change it format to like MP4 and be published in my own player like jwplayer but I don't know where to start any suggestions would be greatly appreciated I just want to upload any video format and it should automatically be converted it to MP4 and published with jwplayer
here is a screen shot where i publish my videos from!
I used ffmpeg to do all my conversions.
You could make your uploaded video files all go to one central folder. Have a batch file that runs ffmpeg on those files and then move it to the another folder once it is processed.
You could upload your file in whatever format, give it a fake .mp4 file name and just have a message that says "file being processed" in the meantime.
File conversion takes time, and a lot of processing power, be sure to try it locally before even considering making your server do all the work.

Display an image from a ZIP file without extracting it to the server (PHP)

On my site, admins can upload ZIP files that contain a set of JPGs. Users can then download the ZIPs. I also want users to be able to preview images from the ZIP file. But I don't want to extract the images into a temp dir on the server and delete them later.
Is there a way to do this? Perhaps with the img "data:" URI scheme?
One way or another, people would have to download parts of that zip file, so you might as well do some server-side processing and generate thumbnails of the images ONCE. Then just serve up those thumbs repeatedly. Otherwise you're going to waste a lot of cpu time repeatedly extracting images, encoding them for data uris, and sending out those data uris.

How to store processed file in users desktop?

I have created a website.In that scaling an image option is created.. Now i want to store that scaled image in users desktop..But its saving in code existing folder..
Please help me by sending php script to store that file in desktop
If your website is going to actually live on the web instead of on people's computers locally then you can't directly save it to their computer. You can serve it to them with php as a file download by setting the proper mime-type and content headers (using header()) followed by the file itself, or better yet offer the user a download link so they can choose to download it themselves.
If your website is going to be used locally (a little odd, but it could happen), then you can use fopen(), fwrite() and fclose() in php to work with local files.
I don't think it is possible to do this without asking for user intervention on where to save the processed file. If you think about it, it would be a significant security flaw if a web server could arbitrarily save files to user desktops!
The best you could do is set the content header of the generated file to have a content disposition of attachment and then the browser will prompt the user where to save the file.

Categories