Jump to content

Recommended Posts

Boa noite galera

eu estou com um modulo de GALERIA DE FOTOS

ele funciona normalmente

no computador carrega certinho

mais quando entra pelo celular ele não vai buscar as fotos

pra carregar

 

Segue o codigo

								<?php } elseif (isset($_GET['AdicionarFotos'])) { ?>
									<?php $id = get('AdicionarFotos'); $Query = DBRead('album','*',"WHERE id = '{$id}'"); if (is_array($Query)) { foreach ($Query as $c_album) { ?>
										<input type="hidden" name="id" value="<?php echo $id; ?>"/>
									    <script type="text/javascript">
									          <?php $timestamp = time();?>
									          $(function() {
									              $('#file_upload').uploadifive({
									                'fileType'  : ["image\/gif","image\/jpeg","image\/png","image\/jpg"],
									                  'auto'             : true,
									                  'checkScript'      : 'css_js/plugins/upload5/check-exists.php',
									                  'buttonText'   : 'Selecionar Imagens',
									                  'formData'         : {
									                                         'timestamp' : '<?php echo $timestamp;?>',
									                                         'token'     : '<?php echo md5('unique_salt' . $timestamp);?>'
									                                       },
									                  'queueID'          : 'queue',
									                  'uploadScript'     : 'controller/album_upload.php?id_album=<?php echo $id ?>',
									                  'onQueueComplete' : function(uploads) {
												            window.location.reload();
												        },
									                  'onUploadComplete' : function(file, data) { /*console.log(data);*/ }
									              });
									          });
									    </script>
									    <div id="queue"></div>
									    <input id="file_upload" name="file_upload" type="file" multiple>
									    <input type="hidden" name="id"value="<?php echo $id; ?>" />
									    <center>
											<em>Info: Para editar o título ou excluir uma imagem, basta clicar sobre ela.</em>
										</center>
										
										<hr>
										

O arquivo do upload esta assim

 

<?php
    set_time_limit(0);
    require_once ('../database/config.php');
    require_once ('../database/config.database.php');
    require_once ('../database/upload.class.php');
    require_once ('../includes/funcoes.php');
    $file_dst_name = "";
    $id = get('id_album');
    $dir_dest = '../wa/album/uploads/';
    $files = array( );
    $files = $_FILES['Filedata'];
    foreach ($files as $file){
        $handle = new Upload($file);
        if ( $handle->uploaded ){
            $handle->file_overwrite = true;

            if ($files['type'] == 'image/jpeg') {
                $handle->file_new_name_ext = 'jpg';
            } elseif ($files['type'] == 'image/png') {
                $handle->file_new_name_ext = 'png';
            } elseif ($files['type'] == 'image/gif') {
                $handle->file_new_name_ext = 'gif';
            }
            
            $handle->file_new_name_body = md5(uniqid(rand(), true));
            $handle->Process($dir_dest);
            if ($handle->processed){
                $file_dst_name = $handle->file_dst_name;
                $Adicionar = array(
                    'imagem' => $file_dst_name, 
                    'data'   => date('Y-m-d'),
                    'id_album' => $id
                );

                $Query = DBCreate('fotos_album', $Adicionar, true);
            }
        }
    }
?>

FICO NA ESPERA VLWW

Share this post


Link to post
Share on other sites

seu problema não é de php, é de jquery, alguma coisa relacionada a esse plugin uploadfy, peça a algum moderador pra mover sua dúvida para Javascript, aqui os meus inputs do tipo File funcionam tanto no desktop quanto no mobile usando apenas HTML

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

Ao usar o fórum, você concorda com nossos Terms of Use.