Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Need check file before upload ajax
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Need check file before upload ajax

jazz1611jazz1611 Member
edited November 2018 in Help

hello,

i have code (PHP) upload multi file with ajax. current, the code can check file exist after upload. now i want it check file exist before upload. the filename after upload converted to md5(filename).mp4

source file: https://github.com/jazz1611/upload-file-ajax

regards,

«1

Comments

  • HBAndreiHBAndrei Member, Top Host, Host Rep

    Maybe upload the code to GitHub, not zippyshare, if you want people to look at it much easier.

    Thanked by 1dedipromo
  • @HBAndrei said:
    Maybe upload the code to GitHub, not zippyshare, if you want people to look at it much easier.

    hello, thank you! i was upload to GitHub, hope you can help me.

  • Kinda hard to understand what you mean. You want to check if user has selected a file to be uploaded before it gets to upload.php?

  • @jazz1611 said:
    hello,

    i have code (PHP) upload multi file with ajax. current, the code can check file exist after upload. now i want it check file exist before upload. the filename after upload converted to md5(filename).mp4

    source file: https://github.com/jazz1611/upload-file-ajax

    regards,

    Okay here is my understanding

    Correct me if i am wrong

    You want to verify the file exists before uploading saving the hassle

    well you can do it using two ways

    1.
    get file name of the file being uploaded and ajax query db/folder directory if file exists

    2.generate md5/sha1 hash of file before uploading and checking the hashed of all the uploades files

    Not sure how you would implement no 2

  • @jetchirag said:
    Kinda hard to understand what you mean. You want to check if user has selected a file to be uploaded before it gets to upload.php?

    Yes, i want the code very/check file have exist or not in folder uploads. If yes, will skip that file. and no will upload.

    @noaman said:

    @jazz1611 said:
    hello,

    i have code (PHP) upload multi file with ajax. current, the code can check file exist after upload. now i want it check file exist before upload. the filename after upload converted to md5(filename).mp4

    source file: https://github.com/jazz1611/upload-file-ajax

    regards,

    Okay here is my understanding

    Correct me if i am wrong

    You want to verify the file exists before uploading saving the hassle

    well you can do it using two ways

    1.
    get file name of the file being uploaded and ajax query db/folder directory if file exists

    2.generate md5/sha1 hash of file before uploading and checking the hashed of all the uploades files

    Not sure how you would implement no 2

    I don't know code ajax/jquery to very/check file have exist in folder upload when start upload. after file uploaded, the filename.mp4 will hash md5(filename).mp4. can you help me to code it? thank you!

  • <?php 
    
    $filename = $_GET['FILENAME'];
    
    if(file_exists($path . $filename){
    
    echo "true";
    
    }
    else {
    
    echo "false";
    
    }
    
    ?>
    
  • @AlyssaD said:

    <?php 
    > 
    > $filename = $_GET['FILENAME'];
    > 
    > if(file_exists($path . $filename){
    > 
    > echo "true";
    > 
    > }
    > else {
    > 
    > echo "false";
    > 
    > }
    > 
    > ?>
    

    i tried this code but ajax not capture the response from "progress-group"

  • @jazz1611 said:

    @AlyssaD said:

    <?php 
    > > 
    > > $filename = $_GET['FILENAME'];
    > > 
    > > if(file_exists($path . $filename){
    > > 
    > > echo "true";
    > > 
    > > }
    > > else {
    > > 
    > > echo "false";
    > > 
    > > }
    > > 
    > > ?>
    

    i tried this code but ajax not capture the response from "progress-group"

    You are supposed to make two queries. One with file list to know if file exists. Another to upload.

  • @jetchirag said:

    @jazz1611 said:

    @AlyssaD said:

    <?php 
    > > > 
    > > > $filename = $_GET['FILENAME'];
    > > > 
    > > > if(file_exists($path . $filename){
    > > > 
    > > > echo "true";
    > > > 
    > > > }
    > > > else {
    > > > 
    > > > echo "false";
    > > > 
    > > > }
    > > > 
    > > > ?>
    

    i tried this code but ajax not capture the response from "progress-group"

    You are supposed to make two queries. One with file list to know if file exists. Another to upload.

    that reason i need help for code to ajax. because the code have public on internet. i don't write that code

  • I have given you a valid example. You need to tweak it to fit your solution.

  • jazz1611 said: that reason i need help for code to ajax. because the code have public on internet. i don't write that code

    Did you take the code from somewhere?

  • @crpatel said:

    jazz1611 said: that reason i need help for code to ajax. because the code have public on internet. i don't write that code

    Did you take the code from somewhere?

    http://www.qhonline.info/php-nang-cao/100/huong-dan-upload-file-bang-ajax-ket-hop-voi-progress-bar.html

  • deankdeank Member, Troll

    I don't think he is looking for advice and tips. He is looking for someone to code him the entire thing (for free).

    Thanked by 2Plioser imok
  • Yap. That's him. He admitted that he took the original code from internet and he specifically ask you guys to help him writing the code.

  • @AlyssaD said:
    I have given you a valid example. You need to tweak it to fit your solution.

    He need a complete code. Not a snippet.

  • Should have gone to fiverr :smiley:

  • Just use Google forms. You don't need to code anything.

  • @yokowasis said:

    @AlyssaD said:
    I have given you a valid example. You need to tweak it to fit your solution.

    He need a complete code. Not a snippet.

    And I am not willing to provide that unless paid.

  • @jazz1611 maybe ist time to offer $15 to AlyssaD

    Thanked by 1armandorg
  • armandorgarmandorg Member, Host Rep

    @ehab said:
    @jazz1611 maybe ist time to offer $15 to AlyssaD

    What if AlyssaD has a higher hour rate? Think about it : |

  • @armandorg said:

    @ehab said:
    @jazz1611 maybe ist time to offer $15 to AlyssaD


    What if AlyssaD has a higher hour rate? Think about it : |

    Rude.

  • @armandorg said:

    well, this can just be the start of negotiations.

  • thank for all, my friend was help me fixed this code. hope mod can close my topic.

  • armandorgarmandorg Member, Host Rep

    @jazz1611 said:
    thank for all, my friend was help me fixed this code. hope mod can close my topic.

    I was about to drop the complete solution to your code, but since you fixed it! : )

    Thanked by 2ehab jazz1611
  • @armandorg said:

    @jazz1611 said:
    thank for all, my friend was help me fixed this code. hope mod can close my topic.


    I was about to drop the complete solution to your code, but since you fixed it! : )

    hello, yes if you can. maybe your code is better than of my friend

  • @jazz1611 said:

    @armandorg said:

    @jazz1611 said:
    thank for all, my friend was help me fixed this code. hope mod can close my topic.


    I was about to drop the complete solution to your code, but since you fixed it! : )

    hello, yes if you can. maybe your code is better than of my friend

    @armandorg You just got called out, bittch!

    Thanked by 1armandorg
  • @jazz1611 now pay $20 to armandorg

    Thanked by 1armandorg
  • deankdeank Member, Troll
    edited November 2018

    Ah, the typical scenario.

    A guy tries to get something done but gets embarrassed instead, so he says his "friend" got it done.

    Happens often on LET.

    Thanked by 2eol armandorg
  • from now on if i see jazy i will ask him to pay.

    Thanked by 1armandorg
  • @deank said:
    Ah, the typical scenario.

    A guy tries to get something done but gets embarrassed instead, so he says his "friend" got it done.

    Happens often on LET.

    Should have gone with @deank fix it for me.

Sign In or Register to comment.