uploading files in yii - php

I'am trying to upload media files (video, audio, images), the upload process done successfully, but in case of video uploading I don't find the video in it's directory on the server, this the code:
$model->fileName=CUploadedFile::getInstance($model, 'fileName');
if($model->save()){
$model->fileName->saveAs(getcwd()."/files/video/".$u->userName."/".$model->fileName);
so, when I open this directing I don't find the uploaded video, what is the problem here?
and can you give me php functions to get the file type and size?
thank you :)

Related

Delete partially uploaded files PHP

I wrote a upload script to upload files in PHP. suppose if some client upload files and those got uploaded partially or failed during upload. I wonder what happens to the file on the server. Does it get deleted ? I am really confused how to handle those partial uploads. Does PHP handle them ?
Any help is accepted

PHP Image Upload - Locked Photos - FTP Error

I've been creating a website in the same way that I usually so, where I add an article + image using HTML & PHP. The difference is that when I upload the photo, even though it displays on the web page, my folder shows an Icon instead of the image (See Below):
As the photos show on the webpage I didn't think much of it, until I tried to upload the website, where I kept getting an FTP upload error on the images. Then when loading the website, I found that none of the images were there.
I'm not sure what the problem is, but when I tried to open one of the photos in Fireworks it says, "Could not open the file. File is locked".
Does anyone know what the probelm is? I'm using the same upload method used previously.

Does ssl block imgur from getting image dimensions?

I'm using php GD library to create an png file, I'm saving it to my server.
URL for the image is
https://server.com/signature/123.png
My problem is I can't upload that image to imgur, I get this error
This issue also occurs on other image uploading sites / forums
However if I decide to download the image to my desktop and upload it to imgur it seems to work. Anyone has an idea on why this is happening?

Thumbnail is not generated while uploading a video which is downloaded from the same server

I am using drupal 7 video module and ffmpeg together to upload video on my site.
My problem:
Upload a video, everything works fine, thumbnail is generated and video is uploaded successfully
Now download the above uploaded video.
Now Try to upload the same video, on same drupal site.
Thumbnail is not generating and also I am not able to play the newly uploaded video.
In all other cases video upload is working fine, I am able to upload same video again and again with no fuss,but when I try to upload the downloaded video , everything goes wrong even if I change the file name after downloading the video and uploading again.
Please let me know if I am not clear, will try to explain more.
I would suggest you take a look at the ffmpeg log/console output when you try to re-upload a previously downloaded file. There could be something wrong while the file is re-processed.
If you need more help please provide the output of the ffmpeg console of the video and a sample file that is not working with encoding/processing settings.

Image gallery loading images from an external server

I am trying to make a php image gallery where the script has to the following things:
Connect to external server (http/ftp)
scan directory "highres"
load images from directory "lowres" with same image name.
save low-res images on local folder
Show low-res images in gallery
Download button for the high-res image
Can anyone point me into the right direction cause i dont know where to start.
Take a look at FTP with PHP and start with reading out the files in the Folder FTP Documentation
Then use ftp_get() to download the first Image and resize it with help of the GDlib, here is a tutorial for a thumbnailing function. Or download all images at once and resize them all at once.
Now you are at the last step just show your thumbnail and link to the high-res images.

Categories